#! /bin/sh
# Generated from local.at by GNU Autoconf 2.71.
#
# Copyright (C) 2009-2017, 2020-2021 Free Software Foundation, Inc.
#
# This test suite is free software; the Free Software Foundation gives
# unlimited permission to copy, distribute and modify it.
## -------------------- ##
## M4sh Initialization. ##
## -------------------- ##
# Be more Bourne compatible
DUALCASE=1; export DUALCASE # for MKS sh
as_nop=:
if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else $as_nop
case `(set -o) 2>/dev/null` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
# Reset variables that may have inherited troublesome values from
# the environment.
# IFS needs to be set, to space, tab, and newline, in precisely that order.
# (If _AS_PATH_WALK were called with IFS unset, it would have the
# side effect of setting IFS to empty, thus disabling word splitting.)
# Quoting is to prevent editors from complaining about space-tab.
as_nl='
'
export as_nl
IFS=" "" $as_nl"
PS1='$ '
PS2='> '
PS4='+ '
# Ensure predictable behavior from utilities with locale-dependent output.
LC_ALL=C
export LC_ALL
LANGUAGE=C
export LANGUAGE
# We cannot yet rely on "unset" to work, but we need these variables
# to be unset--not just set to an empty or harmless value--now, to
# avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct
# also avoids known problems related to "unset" and subshell syntax
# in other old shells (e.g. bash 2.01 and pdksh 5.2.14).
for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH
do eval test \${$as_var+y} \
&& ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
done
# Ensure that fds 0, 1, and 2 are open.
if (exec 3>&0) 2>/dev/null; then :; else exec 0</dev/null; fi
if (exec 3>&1) 2>/dev/null; then :; else exec 1>/dev/null; fi
if (exec 3>&2) ; then :; else exec 2>/dev/null; fi
# The user is always right.
if ${PATH_SEPARATOR+false} :; then
PATH_SEPARATOR=:
(PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
(PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
PATH_SEPARATOR=';'
}
fi
# Find who we are. Look in the path if we contain no directory separator.
as_myself=
case $0 in #((
*[\\/]* ) as_myself=$0 ;;
*) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -r "$as_dir$0" && as_myself=$as_dir$0 && break
done
IFS=$as_save_IFS
;;
esac
# We did not find ourselves, most probably we were run as `sh COMMAND'
# in which case we are not to be found in the path.
if test "x$as_myself" = x; then
as_myself=$0
fi
if test ! -f "$as_myself"; then
printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
exit 1
fi
if test "x$CONFIG_SHELL" = x; then
as_bourne_compatible="as_nop=:
if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1
then :
emulate sh
NULLCMD=:
# Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
# is contrary to our usage. Disable this feature.
alias -g '\${1+\"\$@\"}'='\"\$@\"'
setopt NO_GLOB_SUBST
else \$as_nop
case \`(set -o) 2>/dev/null\` in #(
*posix*) :
set -o posix ;; #(
*) :
;;
esac
fi
"
as_required="as_fn_return () { (exit \$1); }
as_fn_success () { as_fn_return 0; }
as_fn_failure () { as_fn_return 1; }
as_fn_ret_success () { return 0; }
as_fn_ret_failure () { return 1; }
exitcode=0
as_fn_success || { exitcode=1; echo as_fn_success failed.; }
as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
if ( set x; as_fn_ret_success y && test x = \"\$1\" )
then :
else \$as_nop
exitcode=1; echo positional parameters were not saved.
fi
test x\$exitcode = x0 || exit 1
blah=\$(echo \$(echo blah))
test x\"\$blah\" = xblah || exit 1
test -x / || exit 1"
as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
test \$(( 1 + 1 )) = 2 || exit 1"
if (eval "$as_required") 2>/dev/null
then :
as_have_required=yes
else $as_nop
as_have_required=no
fi
if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null
then :
else $as_nop
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_found=false
for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
as_found=:
case $as_dir in #(
/*)
for as_base in sh bash ksh sh5; do
# Try only shells that exist, to save several forks.
as_shell=$as_dir$as_base
if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$as_shell as_have_required=yes
if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null
then :
break 2
fi
fi
done;;
esac
as_found=false
done
IFS=$as_save_IFS
if $as_found
then :
else $as_nop
if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null
then :
CONFIG_SHELL=$SHELL as_have_required=yes
fi
fi
if test "x$CONFIG_SHELL" != x
then :
export CONFIG_SHELL
# We cannot yet assume a decent shell, so we have to provide a
# neutralization value for shells without unset; and this also
# works around shells that cannot unset nonexistent variables.
# Preserve -v and -x to the replacement shell.
BASH_ENV=/dev/null
ENV=/dev/null
(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
case $- in # ((((
*v*x* | *x*v* ) as_opts=-vx ;;
*v* ) as_opts=-v ;;
*x* ) as_opts=-x ;;
* ) as_opts= ;;
esac
exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"}
# Admittedly, this is quite paranoid, since all the known shells bail
# out after a failed `exec'.
printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2
exit 255
fi
if test x$as_have_required = xno
then :
printf "%s\n" "$0: This script requires a shell more modern than all"
printf "%s\n" "$0: the shells that I found on your system."
if test ${ZSH_VERSION+y} ; then
printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should"
printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later."
else
printf "%s\n" "$0: Please tell bug-autoconf@gnu.org about your system,
$0: including any error possibly output before this
$0: message. Then install a modern shell, or manually run
$0: the script under such a shell if you do have one."
fi
exit 1
fi
fi
fi
SHELL=${CONFIG_SHELL-/bin/sh}
export SHELL
# Unset more variables known to interfere with behavior of common tools.
CLICOLOR_FORCE= GREP_OPTIONS=
unset CLICOLOR_FORCE GREP_OPTIONS
## --------------------- ##
## M4sh Shell Functions. ##
## --------------------- ##
# as_fn_unset VAR
# ---------------
# Portably unset VAR.
as_fn_unset ()
{
{ eval $1=; unset $1;}
}
as_unset=as_fn_unset
# as_fn_set_status STATUS
# -----------------------
# Set $? to STATUS, without forking.
as_fn_set_status ()
{
return $1
} # as_fn_set_status
# as_fn_exit STATUS
# -----------------
# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
as_fn_exit ()
{
set +e
as_fn_set_status $1
exit $1
} # as_fn_exit
# as_fn_nop
# ---------
# Do nothing but, unlike ":", preserve the value of $?.
as_fn_nop ()
{
return $?
}
as_nop=as_fn_nop
# as_fn_mkdir_p
# -------------
# Create "$as_dir" as a directory, including parents if necessary.
as_fn_mkdir_p ()
{
case $as_dir in #(
-*) as_dir=./$as_dir;;
esac
test -d "$as_dir" || eval $as_mkdir_p || {
as_dirs=
while :; do
case $as_dir in #(
*\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
*) as_qdir=$as_dir;;
esac
as_dirs="'$as_qdir' $as_dirs"
as_dir=`$as_dirname -- "$as_dir" ||
$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X"$as_dir" : 'X\(//\)[^/]' \| \
X"$as_dir" : 'X\(//\)$' \| \
X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X"$as_dir" |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
test -d "$as_dir" && break
done
test -z "$as_dirs" || eval "mkdir $as_dirs"
} || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
} # as_fn_mkdir_p
# as_fn_executable_p FILE
# -----------------------
# Test if FILE is an executable regular file.
as_fn_executable_p ()
{
test -f "$1" && test -x "$1"
} # as_fn_executable_p
# as_fn_append VAR VALUE
# ----------------------
# Append the text in VALUE to the end of the definition contained in VAR. Take
# advantage of any shell optimizations that allow amortized linear growth over
# repeated appends, instead of the typical quadratic growth present in naive
# implementations.
if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null
then :
eval 'as_fn_append ()
{
eval $1+=\$2
}'
else $as_nop
as_fn_append ()
{
eval $1=\$$1\$2
}
fi # as_fn_append
# as_fn_arith ARG...
# ------------------
# Perform arithmetic evaluation on the ARGs, and store the result in the
# global $as_val. Take advantage of shells that can avoid forks. The arguments
# must be portable across $(()) and expr.
if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null
then :
eval 'as_fn_arith ()
{
as_val=$(( $* ))
}'
else $as_nop
as_fn_arith ()
{
as_val=`expr "$@" || test $? -eq 1`
}
fi # as_fn_arith
# as_fn_error STATUS ERROR [LINENO LOG_FD]
# ----------------------------------------
# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
# script with STATUS, using 1 if that was 0.
as_fn_error ()
{
as_status=$1; test $as_status -eq 0 && as_status=1
if test "$4"; then
as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
fi
printf "%s\n" "$as_me: error: $2" >&2
as_fn_exit $as_status
} # as_fn_error
if expr a : '\(a\)' >/dev/null 2>&1 &&
test "X`expr 00001 : '.*\(...\)'`" = X001; then
as_expr=expr
else
as_expr=false
fi
if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
as_basename=basename
else
as_basename=false
fi
as_me=`$as_basename -- "$0" ||
$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
X"$0" : 'X\(//\)$' \| \
X"$0" : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X/"$0" |
sed '/^.*\/\([^/][^/]*\)\/*$/{
s//\1/
q
}
/^X\/\(\/\/\)$/{
s//\1/
q
}
/^X\/\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
as_dirname=dirname
else
as_dirname=false
fi
# Avoid depending upon Character Ranges.
as_cr_letters='abcdefghijklmnopqrstuvwxyz'
as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
as_cr_Letters=$as_cr_letters$as_cr_LETTERS
as_cr_digits='0123456789'
as_cr_alnum=$as_cr_Letters$as_cr_digits
as_lineno_1=$LINENO as_lineno_1a=$LINENO
as_lineno_2=$LINENO as_lineno_2a=$LINENO
eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
# Blame Lee E. McMahon (1931-1989) for sed's syntax. :-)
sed -n '
p
/[$]LINENO/=
' <$as_myself |
sed '
s/[$]LINENO.*/&-/
t lineno
b
:lineno
N
:loop
s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
t loop
s/-\n.*//
' >$as_me.lineno &&
chmod +x "$as_me.lineno" ||
{ printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
# If we had to re-execute with $CONFIG_SHELL, we're ensured to have
# already done that, so ensure we don't try to do so again and fall
# in an infinite loop. This has already happened in practice.
_as_can_reexec=no; export _as_can_reexec
# Don't try to exec as it changes $[0], causing all sort of problems
# (the dirname of $[0] is not the place where we might find the
# original and so on. Autoconf is especially sensitive to this).
. "./$as_me.lineno"
# Exit status is that of the last command.
exit
}
# Determine whether it's possible to make 'echo' print without a newline.
# These variables are no longer used directly by Autoconf, but are AC_SUBSTed
# for compatibility with existing Makefiles.
ECHO_C= ECHO_N= ECHO_T=
case `echo -n x` in #(((((
-n*)
case `echo 'xy\c'` in
*c*) ECHO_T=' ';; # ECHO_T is single tab character.
xy) ECHO_C='\c';;
*) echo `echo ksh88 bug on AIX 6.1` > /dev/null
ECHO_T=' ';;
esac;;
*)
ECHO_N='-n';;
esac
# For backward compatibility with old third-party macros, we provide
# the shell variables $as_echo and $as_echo_n. New code should use
# AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively.
as_echo='printf %s\n'
as_echo_n='printf %s'
rm -f conf$$ conf$$.exe conf$$.file
if test -d conf$$.dir; then
rm -f conf$$.dir/conf$$.file
else
rm -f conf$$.dir
mkdir conf$$.dir 2>/dev/null
fi
if (echo >conf$$.file) 2>/dev/null; then
if ln -s conf$$.file conf$$ 2>/dev/null; then
as_ln_s='ln -s'
# ... but there are two gotchas:
# 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
# 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
# In both cases, we have to default to `cp -pR'.
ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
as_ln_s='cp -pR'
elif ln conf$$.file conf$$ 2>/dev/null; then
as_ln_s=ln
else
as_ln_s='cp -pR'
fi
else
as_ln_s='cp -pR'
fi
rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
rmdir conf$$.dir 2>/dev/null
if mkdir -p . 2>/dev/null; then
as_mkdir_p='mkdir -p "$as_dir"'
else
test -d ./-p && rmdir ./-p
as_mkdir_p=false
fi
as_test_x='test -x'
as_executable_p=as_fn_executable_p
# Sed expression to map a string onto a valid CPP name.
as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
# Sed expression to map a string onto a valid variable name.
as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
SHELL=${CONFIG_SHELL-/bin/sh}
# How were we run?
at_cli_args="$@"
# Not all shells have the 'times' builtin; the subshell is needed to make
# sure we discard the 'times: not found' message from the shell.
at_times_p=false
(times) >/dev/null 2>&1 && at_times_p=:
# CLI Arguments to pass to the debugging scripts.
at_debug_args=
# -e sets to true
at_errexit_p=false
# Shall we be verbose? ':' means no, empty means yes.
at_verbose=:
at_quiet=
# Running several jobs in parallel, 0 means as many as test groups.
at_jobs=1
at_traceon=:
at_trace_echo=:
at_check_filter_trace=:
# Shall we keep the debug scripts? Must be `:' when the suite is
# run by a debug script, so that the script doesn't remove itself.
at_debug_p=false
# Display help message?
at_help_p=false
# Display the version message?
at_version_p=false
# List test groups?
at_list_p=false
# --clean
at_clean=false
# Test groups to run
at_groups=
# Whether to rerun failed tests.
at_recheck=
# Whether a write failure occurred
at_write_fail=0
# The directory we run the suite in. Default to . if no -C option.
at_dir=`pwd`
# An absolute reference to this testsuite script.
case $as_myself in
[\\/]* | ?:[\\/]* ) at_myself=$as_myself ;;
* ) at_myself=$at_dir/$as_myself ;;
esac
# Whether -C is in effect.
at_change_dir=false
# Whether to enable colored test results.
at_color=auto
# As many question marks as there are digits in the last test group number.
# Used to normalize the test group numbers so that `ls' lists them in
# numerical order.
at_format='???'
# Description of all the test groups.
at_help_all="1;m4.at:21;Generating Comments;;
2;input.at:27;Invalid number of arguments;;
3;input.at:58;Invalid options;;
4;input.at:83;Invalid inputs;;
5;input.at:147;Invalid inputs with {};;
6;input.at:173;Yacc warnings on symbols;;
7;input.at:204;Yacc warnings;;
8;input.at:238;Yacc's %type;;
9;input.at:287;Invalid symbol declarations;;
10;input.at:341;Redefining the error token;;
11;input.at:401;Dangling aliases;;
12;input.at:427;Symbol declarations;;
13;input.at:528;Invalid \$n and @n;;
14;input.at:552;Type Clashes;;
15;input.at:774;Unused values;;
16;input.at:784;Unused values before symbol declarations;;
17;input.at:794;Symbol redeclared;;
18;input.at:832;EOF redeclared;;
19;input.at:859;Symbol class redefinition;;
20;input.at:899;Default %printer and %destructor redeclared;;
21;input.at:970;Per-type %printer and %destructor redeclared;;
22;input.at:1013;Undefined symbols;;
23;input.at:1045;Unassociated types used for a printer or destructor;;
24;input.at:1074;Useless printers or destructors;;
25;input.at:1139;Unused values with default %destructor;;
26;input.at:1187;Unused values with per-type %destructor;;
27;input.at:1219;Duplicate string;;
28;input.at:1247;Token collisions;;
29;input.at:1275;Incompatible Aliases;;
30;input.at:1400;Torturing the Scanner;;
31;input.at:1569;Typed symbol aliases;;
32;input.at:1609;Require 1.0;;
33;input.at:1610;Require 3.8.2;;
34;input.at:1612;Require 100.0;;
35;input.at:1619;String aliases for character tokens;;
36;input.at:1642;Symbols;;
37;input.at:1708;Numbered tokens;;
38;input.at:1750;Unclosed constructs;;
39;input.at:1805;%start after first rule;;
40;input.at:1826;Duplicate %start symbol;multistart;
41;input.at:1895;%prec takes a token;;
42;input.at:1916;%prec's token must be defined;;
43;input.at:1936;Reject unused %code qualifiers;;
44;input.at:2025;Multiple %code;;
45;input.at:2065;errors;;
46;input.at:2102;%define, --define, --force-define;;
47;input.at:2170;\"%define\" Boolean variables;;
48;input.at:2191;\"%define\" code variables;;
49;input.at:2224;\"%define\" keyword variables;;
50;input.at:2257;\"%define\" enum variables;;
51;input.at:2320;\"%define\" file variables;;
52;input.at:2342;\"%define\" backward compatibility;;
53;input.at:2393;Unused api.pure;;
54;input.at:2429;C++ namespace reference errors;;
55;input.at:2482;Bad character literals;;
56;input.at:2543;Bad escapes in literals;;
57;input.at:2582;Unexpected end of file;;
58;input.at:2675;LAC: Errors for %define;lac;
59;input.at:2719;-Werror combinations;;
60;input.at:2764;%name-prefix and api.prefix are incompatible;;
61;input.at:2793;Redefined %union name;;
62;input.at:2840;Stray \$ or @;;
63;input.at:2883;Code injection;;
64;input.at:2946;Deprecated directives;deprec;
65;input.at:3077;Unput's effect on locations;deprec;
66;input.at:3113;Non-deprecated directives;deprec;
67;input.at:3148;Cannot type action;;
68;input.at:3171;Character literals and api.token.raw;;
69;input.at:3205;%token-table and parse.error;;
70;input.at:3231;Invalid file prefix mapping arguments;;
71;named-refs.at:22;Tutorial calculator;;
72;named-refs.at:196;Undefined and ambiguous references;;
73;named-refs.at:297;Misleading references;;
74;named-refs.at:316;Many kinds of errors;;
75;named-refs.at:551;Missing identifiers in brackets;;
76;named-refs.at:567;Redundant words in brackets;;
77;named-refs.at:583;Comments in brackets;;
78;named-refs.at:599;Stray symbols in brackets;;
79;named-refs.at:618;Redundant words in LHS brackets;;
80;named-refs.at:635;Factored LHS;;
81;named-refs.at:648;Unresolved references;;
82;named-refs.at:715;\$ or @ followed by . or -;;
83;output.at:68;Output files: -dv;;
84;output.at:74;Output files: -dv >&-;;
85;output.at:81;Output files: -dv -o foo.c;;
86;output.at:84;Output files: -dv -y;;
87;output.at:87;Output files: api.header.include={\"./foo.h\"} -dv -y;;
88;output.at:92;Output files: -dv -o foo.tab.c;;
89;output.at:95;Output files: --fixed-output-files -dv -g --html;;
90;output.at:97;Output files: -Hfoo.header -v -gfoo.gv --html=foo.html;;
91;output.at:100;Output files: -dv -g --xml --fixed-output-files;;
92;output.at:102;Output files: -dv -g --xml -y;;
93;output.at:104;Output files: %require \"3.4\" -dv -g --xml -y;;
94;output.at:107;Output files: -dv -g --xml -o y.tab.c;;
95;output.at:110;Output files: -dv -b bar;;
96;output.at:112;Output files: -dv -g -o foo.c;;
97;output.at:116;Output files: %header %verbose ;;
98;output.at:118;Output files: %header %verbose %yacc ;;
99;output.at:121;Output files: %header %verbose %yacc ;;
100;output.at:125;Output files: %file-prefix \"bar\" %header %verbose ;;
101;output.at:127;Output files: %output \"bar.c\" %header %verbose %yacc ;;
102;output.at:129;Output files: %file-prefix \"baz\" %output \"bar.c\" %header %verbose %yacc ;;
103;output.at:136;Output files: %header %verbose ;;
104;output.at:139;Output files: %header %verbose -o foo.c;;
105;output.at:142;Output files: --header=foo.hpp -o foo.c++;;
106;output.at:146;Output files: --header=foo.hpp -o foo.c++;;
107;output.at:150;Output files: %header \"foo.hpp\" -o foo.c++;;
108;output.at:154;Output files: -o foo.c++ --graph=foo.gph;;
109;output.at:160;Output files: %type <foo> useless --header --graph --xml --report=all -Wall -Werror;;
110;output.at:167;Output files: useless=--header --graph --xml --report=all -Wall -Werror;;
111;output.at:173;Output files: %defines -o foo.c++;;
112;output.at:176;Output files: %defines \"foo.hpp\" -o foo.c++;;
113;output.at:191;Output files: lalr1.cc ;;
114;output.at:194;Output files: lalr1.cc %verbose ;;
115;output.at:197;Output files: lalr1.cc %header %verbose ;;
116;output.at:200;Output files: lalr1.cc %verbose %locations ;;
117;output.at:203;Output files: lalr1.cc %header %verbose %locations ;;
118;output.at:206;Output files: lalr1.cc %header %verbose ;;
119;output.at:210;Output files: lalr1.cc %header %verbose %locations -o subdir/foo.cc;;
120;output.at:215;Output files: lalr1.cc %header %verbose %file-prefix \"output_dir/foo\" ;;
121;output.at:220;Output files: lalr1.cc %header %locations %verbose %file-prefix \"output_dir/foo\" ;;
122;output.at:226;Output files: lalr1.cc %header %locations api.location.file=none %require \"3.2\" ;;
123;output.at:231;Output files: lalr1.cc %header %locations api.location.file=\"foo.loc.hh\" %require \"3.2\" ;;
124;output.at:237;Output files: lalr1.cc %header %locations api.location.file=\"\$at_dir/foo.loc.hh\" %require \"3.2\" ;;
125;output.at:267;Conflicting output files: --graph=\"foo.tab.c\";;
126;output.at:272;Conflicting output files: %header \"foo.output\" -v;;
127;output.at:277;Conflicting output files: lalr1.cc %header %locations --graph=\"location.hh\";;
128;output.at:282;Conflicting output files: -o foo.y;;
129;output.at:328;Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .';c++;
130;output.at:335;Output file name: (;c++;
131;output.at:336;Output file name: );c++;
132;output.at:337;Output file name: #;c++;
133;output.at:338;Output file name: @@;c++;
134;output.at:339;Output file name: @{;c++;
135;output.at:340;Output file name: @};c++;
136;output.at:341;Output file name: [;c++;
137;output.at:342;Output file name: ];c++;
138;output.at:363;Graph with no conflicts;graph;
139;output.at:403;Graph with unsolved S/R;graph;
140;output.at:473;Graph with solved S/R;graph;
141;output.at:538;Graph with R/R;graph;
142;output.at:576;Graph with reductions with multiple LAT;graph;
143;output.at:641;Graph with a reduction rule both enabled and disabled;graph;
144;output.at:744;C++ Output File Prefix Mapping;c++;
145;diagnostics.at:84;Warnings;diagnostics;
146;diagnostics.at:133;Single point locations;diagnostics;
147;diagnostics.at:182;Line is too short, and then you die;diagnostics;
148;diagnostics.at:217;Zero-width characters;diagnostics;
149;diagnostics.at:235;Tabulations and multibyte characters;diagnostics;
150;diagnostics.at:282;Tabulations and multibyte characters;diagnostics;
151;diagnostics.at:303;Special files;diagnostics;
152;diagnostics.at:328;Complaints from M4;diagnostics;
153;diagnostics.at:351;Carriage return;diagnostics;
154;diagnostics.at:372;CR NL;diagnostics;
155;diagnostics.at:399;Screen width: 200 columns;diagnostics;
156;diagnostics.at:432;Screen width: 80 columns;diagnostics;
157;diagnostics.at:465;Screen width: 60 columns;diagnostics;
158;diagnostics.at:504;Suggestions;diagnostics;
159;diagnostics.at:527;Counterexamples;diagnostics cex;
160;diagnostics.at:645;Deep Counterexamples;diagnostics cex;
161;diagnostics.at:713;Indentation with message suppression;;
162;skeletons.at:25;Relative skeleton file names;;
163;skeletons.at:85;Installed skeleton file names;;
164;skeletons.at:142;Boolean=variables: invalid skeleton defaults;;
165;skeletons.at:166;Complaining during macro argument expansion;;
166;skeletons.at:248;Fatal errors make M4 exit immediately;;
167;skeletons.at:302;Fatal errors but M4 continues producing output;;
168;sets.at:27;Nullable;;
169;sets.at:111;Broken Closure;;
170;sets.at:153;Firsts;;
171;sets.at:228;Accept;;
172;sets.at:269;Build relations;;
173;sets.at:315;Reduced Grammar;;
174;sets.at:394;Reduced Grammar with prec and assoc;;
175;reduce.at:26;Useless Terminals;;
176;reduce.at:70;Useless Nonterminals;;
177;reduce.at:120;Useless Rules;report;
178;reduce.at:224;Useless Parts;;
179;reduce.at:312;Reduced Automaton;report;
180;reduce.at:406;Underivable Rules;report;
181;reduce.at:452;Bad start symbols;multistart;
182;reduce.at:550;no lr.type: Single State Split;;
183;reduce.at:550;lr.type=lalr: Single State Split;;
184;reduce.at:550;lr.type=ielr: Single State Split;;
185;reduce.at:550;lr.type=canonical-lr: Single State Split;;
186;reduce.at:783;no lr.type: Lane Split;;
187;reduce.at:783;lr.type=lalr: Lane Split;;
188;reduce.at:783;lr.type=ielr: Lane Split;;
189;reduce.at:783;lr.type=canonical-lr: Lane Split;;
190;reduce.at:1027;no lr.type: Complex Lane Split;;
191;reduce.at:1027;lr.type=lalr: Complex Lane Split;;
192;reduce.at:1027;lr.type=ielr: Complex Lane Split;;
193;reduce.at:1027;lr.type=canonical-lr: Complex Lane Split;;
194;reduce.at:1296;no lr.type: Split During Added Lookahead Propagation;;
195;reduce.at:1296;lr.type=lalr: Split During Added Lookahead Propagation;;
196;reduce.at:1296;lr.type=ielr: Split During Added Lookahead Propagation;;
197;reduce.at:1296;lr.type=canonical-lr: Split During Added Lookahead Propagation;;
198;reduce.at:1627;no lr.default-reduction;;
199;reduce.at:1627;lr.default-reduction=most;;
200;reduce.at:1627;lr.default-reduction=consistent;;
201;reduce.at:1627;lr.default-reduction=accepting;;
202;report.at:37;Reports;report html;
203;report.at:3123;Reports with conflicts;cex report html;
204;conflicts.at:28;Token declaration order;;
205;conflicts.at:101;Token declaration order: literals vs. identifiers;;
206;conflicts.at:183;Useless associativity warning;;
207;conflicts.at:218;Useless precedence warning;;
208;conflicts.at:275;S/R in initial;;
209;conflicts.at:301;%nonassoc and eof;;
210;conflicts.at:509;parse.error=verbose and consistent errors: lr.type=ielr;;
211;conflicts.at:513;parse.error=verbose and consistent errors: lr.type=ielr %glr-parser;glr;
212;conflicts.at:518;parse.error=verbose and consistent errors: lr.type=ielr c++;c++;
213;conflicts.at:523;parse.error=verbose and consistent errors: lr.type=ielr java;java;
214;conflicts.at:530;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent;;
215;conflicts.at:535;parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting;;
216;conflicts.at:540;parse.error=verbose and consistent errors: lr.type=canonical-lr;;
217;conflicts.at:546;parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full;;
218;conflicts.at:551;parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full;;
219;conflicts.at:558;parse.error=verbose and consistent errors: c++ lr.type=canonical-lr parse.lac=full;c++;
220;conflicts.at:564;parse.error=verbose and consistent errors: c++ lr.type=ielr parse.lac=full;c++;
221;conflicts.at:622;parse.error=verbose and consistent errors: ;;
222;conflicts.at:626;parse.error=verbose and consistent errors: %glr-parser;glr;
223;conflicts.at:632;parse.error=verbose and consistent errors: lr.default-reduction=consistent;;
224;conflicts.at:638;parse.error=verbose and consistent errors: lr.default-reduction=accepting;;
225;conflicts.at:642;parse.error=verbose and consistent errors: lr.type=canonical-lr;;
226;conflicts.at:647;parse.error=verbose and consistent errors: parse.lac=full;;
227;conflicts.at:651;parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting;;
228;conflicts.at:676;LAC: %nonassoc requires splitting canonical LR states;;
229;conflicts.at:764;Unresolved SR Conflicts;cex report;
230;conflicts.at:887;Resolved SR Conflicts;report;
231;conflicts.at:989;%precedence suffices;;
232;conflicts.at:1015;%precedence does not suffice;;
233;conflicts.at:1096;Syntax error in consistent error state: yacc.c;;
234;conflicts.at:1096;Syntax error in consistent error state: glr.c;glr;
235;conflicts.at:1096;Syntax error in consistent error state: lalr1.cc;c++;
236;conflicts.at:1096;Syntax error in consistent error state: glr.cc;glr c++;
237;conflicts.at:1096;Syntax error in consistent error state: glr2.cc;glr c++;
238;conflicts.at:1127;Defaulted Conflicted Reduction;cex report;
239;conflicts.at:1264;%expect not enough;;
240;conflicts.at:1284;%expect right;;
241;conflicts.at:1301;%expect too much;;
242;conflicts.at:1321;%expect with reduce conflicts;;
243;conflicts.at:1341;%expect in grammar rule not enough;;
244;conflicts.at:1360;%expect in grammar rule right;;
245;conflicts.at:1377;%expect in grammar rules;;
246;conflicts.at:1396;%expect in grammar rule too much;;
247;conflicts.at:1415;%expect-rr in grammar rule;;
248;conflicts.at:1440;%expect-rr too much in grammar rule;;
249;conflicts.at:1469;%expect-rr not enough in grammar rule;;
250;conflicts.at:1498;%prec with user string;;
251;conflicts.at:1515;%no-default-prec without %prec;;
252;conflicts.at:1544;%no-default-prec with %prec;;
253;conflicts.at:1568;%default-prec;;
254;conflicts.at:1592;Unreachable States After Conflict Resolution;cex report;
255;conflicts.at:1855;Solved conflicts report for multiple reductions in a state;;
256;conflicts.at:1935;%nonassoc error actions for multiple reductions in a state;cex report;
257;conflicts.at:2299;%expect-rr non GLR;;
258;conflicts.at:2331;-W versus %expect and %expect-rr;;
259;counterexample.at:43;Unifying S/R;cex;
260;counterexample.at:83;Deep Unifying S/R;cex;
261;counterexample.at:144;S/R Conflict with Nullable Symbols;cex;
262;counterexample.at:207;Non-unifying Ambiguous S/R;cex;
263;counterexample.at:254;Non-unifying Unambiguous S/R;cex;
264;counterexample.at:298;S/R after first token;cex;
265;counterexample.at:363;Unifying R/R counterexample;cex;
266;counterexample.at:399;Non-unifying R/R LR(1) conflict;cex;
267;counterexample.at:441;Non-unifying R/R LR(2) conflict;cex;
268;counterexample.at:488;Cex Search Prepend;cex;
269;counterexample.at:550;R/R cex with prec;cex;
270;counterexample.at:610;Null nonterminals;cex;
271;counterexample.at:797;Non-unifying Prefix Share;cex;
272;counterexample.at:842;Deep Null Unifying;cex;
273;counterexample.at:884;Deep Null Non-unifying;cex;
274;synclines.at:194;Prologue syncline;;
275;synclines.at:214;%union syncline;;
276;synclines.at:237;%union name syncline;;
277;synclines.at:264;Postprologue syncline;;
278;synclines.at:291;Action syncline;;
279;synclines.at:310;Epilogue syncline;;
280;synclines.at:327;%code top syncline;;
281;synclines.at:346;%destructor syncline;;
282;synclines.at:370;%printer syncline;;
283;synclines.at:440;syncline escapes: yacc.c;;
284;synclines.at:440;syncline escapes: glr.c;glr;
285;synclines.at:440;syncline escapes: lalr1.cc;c++;
286;synclines.at:440;syncline escapes: glr.cc;glr c++;
287;synclines.at:440;syncline escapes: glr2.cc;glr c++;
288;synclines.at:497;%no-lines: yacc.c;;
289;synclines.at:497;%no-lines: glr.c;glr;
290;synclines.at:497;%no-lines: lalr1.cc;;
291;synclines.at:497;%no-lines: glr.cc;glr;
292;synclines.at:497;%no-lines: glr2.cc;glr;
293;synclines.at:507;Output columns;;
294;headers.at:56;Invalid CPP guards: --defines=input/input.h;;
295;headers.at:57;Invalid CPP guards: --defines=9foo.h;;
296;headers.at:58;Invalid CPP guards: %glr-parser --defines=input/input.h;glr;
297;headers.at:59;Invalid CPP guards: %glr-parser --defines=9foo.h;glr;
298;headers.at:67;export YYLTYPE;;
299;headers.at:177;Sane headers: ;;
300;headers.at:178;Sane headers: %locations %debug;;
301;headers.at:180;Sane headers: %glr-parser;glr;
302;headers.at:181;Sane headers: %locations %debug %glr-parser;glr;
303;headers.at:183;Sane headers: api.pure;;
304;headers.at:184;Sane headers: api.push-pull=both;push;
305;headers.at:185;Sane headers: api.pure api.push-pull=both;push;
306;headers.at:187;Sane headers: c++;c++;
307;headers.at:188;Sane headers: %locations %debug c++;c++;
308;headers.at:189;Sane headers: c++ api.value.type=variant parse.assert;c++;
309;headers.at:191;Sane headers: %locations c++ %glr-parser;glr c++;
310;headers.at:199;Several parsers;glr c++ push;
311;actions.at:24;Midrule actions;;
312;actions.at:72;Typed midrule actions;;
313;actions.at:122;Implicitly empty rule;;
314;actions.at:172;Invalid uses of %empty;;
315;actions.at:240;Valid uses of %empty;;
316;actions.at:270;Add missing %empty;;
317;actions.at:365;Initial location: yacc.c ;;
318;actions.at:366;Initial location: yacc.c api.pure=full;;
319;actions.at:367;Initial location: yacc.c api.pure %parse-param { int x };;
320;actions.at:368;Initial location: yacc.c api.push-pull=both;push;
321;actions.at:369;Initial location: yacc.c api.push-pull=both api.pure=full;push;
322;actions.at:370;Initial location: glr.c ;glr;
323;actions.at:371;Initial location: glr.c api.pure;glr;
324;actions.at:372;Initial location: lalr1.cc ;c++;
325;actions.at:373;Initial location: glr.cc ;glr c++;
326;actions.at:374;Initial location: glr2.cc ;glr c++;
327;actions.at:383;Initial location: yacc.c api.pure=full;;
328;actions.at:394;Initial location: yacc.c api.pure=full;;
329;actions.at:478;Location print: yacc.c ;;
330;actions.at:478;Location print: glr.c ;glr;
331;actions.at:478;Location print: lalr1.cc ;c++;
332;actions.at:478;Location print: glr.cc ;glr c++;
333;actions.at:478;Location print: glr2.cc ;glr c++;
334;actions.at:488;Exotic Dollars;;
335;actions.at:1047;Printers and Destructors;;
336;actions.at:1048;Printers and Destructors with union;;
337;actions.at:1050;Printers and Destructors: %glr-parser;glr;
338;actions.at:1051;Printers and Destructors with union: %glr-parser;glr;
339;actions.at:1053;Printers and Destructors: %header lalr1.cc;c++;
340;actions.at:1054;Printers and Destructors with union: %header lalr1.cc;c++;
341;actions.at:1056;Printers and Destructors: %header glr.cc;glr c++;
342;actions.at:1057;Printers and Destructors with union: %header glr.cc;glr c++;
343;actions.at:1059;Printers and Destructors: %header glr2.cc;glr c++;
344;actions.at:1060;Printers and Destructors with union: %header glr2.cc;glr c++;
345;actions.at:1071;Default tagless %printer and %destructor;;
346;actions.at:1174;Default tagged and per-type %printer and %destructor;;
347;actions.at:1307;Default %printer and %destructor for user-defined end token;;
348;actions.at:1429;Default %printer and %destructor are not for error or \$undefined;;
349;actions.at:1532;Default %printer and %destructor are not for \$accept;;
350;actions.at:1596;Default %printer and %destructor for midrule values;;
351;actions.at:1743;@\$ in %initial-action implies %locations;;
352;actions.at:1744;@\$ in %destructor implies %locations;;
353;actions.at:1745;@\$ in %printer implies %locations;;
354;actions.at:1856;Qualified \$\$ in actions: yacc.c;;
355;actions.at:1856;Qualified \$\$ in actions: glr.c;glr;
356;actions.at:1856;Qualified \$\$ in actions: lalr1.cc;c++;
357;actions.at:1856;Qualified \$\$ in actions: glr.cc;glr c++;
358;actions.at:1856;Qualified \$\$ in actions: glr2.cc;glr c++;
359;actions.at:1863;Destroying lookahead assigned by semantic action;;
360;actions.at:1918;YYBACKUP;;
361;types.at:25;%union vs. api.value.type;;
362;types.at:44;%yacc vs. api.value.type=union;;
363;types.at:139;yacc.c api.value.type={double};api.value.type;
364;types.at:139;yacc.c api.value.type={double} %header;api.value.type;
365;types.at:139;yacc.c api.value.type={variant};api.value.type;
366;types.at:139;yacc.c api.value.type={variant} %header;api.value.type;
367;types.at:139;yacc.c api.value.type={struct foo};api.value.type;
368;types.at:139;yacc.c api.value.type={struct foo} %header;api.value.type;
369;types.at:139;yacc.c api.value.type={struct bar};api.value.type;
370;types.at:139;yacc.c api.value.type={struct bar} %header;api.value.type;
371;types.at:139;yacc.c api.value.type={union foo};api.value.type;
372;types.at:139;yacc.c api.value.type={union foo} %header;api.value.type;
373;types.at:139;yacc.c %union { float fval; int ival; };;api.value.type;
374;types.at:139;yacc.c %union { float fval; int ival; }; %header;api.value.type;
375;types.at:139;yacc.c %union foo { float fval; int ival; };;api.value.type;
376;types.at:139;yacc.c %union foo { float fval; int ival; }; %header;api.value.type;
377;types.at:139;yacc.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type;
378;types.at:139;yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %header;api.value.type;
379;types.at:139;yacc.c api.value.type=union;api.value.type;
380;types.at:139;yacc.c api.value.type=union %header;api.value.type;
381;types.at:139;glr.c api.value.type={double};api.value.type glr;
382;types.at:139;glr.c api.value.type={double} %header;api.value.type glr;
383;types.at:139;glr.c api.value.type={variant};api.value.type glr;
384;types.at:139;glr.c api.value.type={variant} %header;api.value.type glr;
385;types.at:139;glr.c api.value.type={struct foo};api.value.type glr;
386;types.at:139;glr.c api.value.type={struct foo} %header;api.value.type glr;
387;types.at:139;glr.c api.value.type={struct bar};api.value.type glr;
388;types.at:139;glr.c api.value.type={struct bar} %header;api.value.type glr;
389;types.at:139;glr.c api.value.type={union foo};api.value.type glr;
390;types.at:139;glr.c api.value.type={union foo} %header;api.value.type glr;
391;types.at:139;glr.c %union { float fval; int ival; };;api.value.type glr;
392;types.at:139;glr.c %union { float fval; int ival; }; %header;api.value.type glr;
393;types.at:139;glr.c %union foo { float fval; int ival; };;api.value.type glr;
394;types.at:139;glr.c %union foo { float fval; int ival; }; %header;api.value.type glr;
395;types.at:139;glr.c api.value.union.name=foo; %union { float fval; int ival; };;api.value.type glr;
396;types.at:139;glr.c api.value.union.name=foo; %union { float fval; int ival; }; %header;api.value.type glr;
397;types.at:139;glr.c api.value.type=union;api.value.type glr;
398;types.at:139;glr.c api.value.type=union %header;api.value.type glr;
399;types.at:139;lalr1.cc api.value.type={double};api.value.type c++;
400;types.at:139;lalr1.cc api.value.type={double} %header;api.value.type c++;
401;types.at:139;lalr1.cc api.value.type={variant};api.value.type c++;
402;types.at:139;lalr1.cc api.value.type={variant} %header;api.value.type c++;
403;types.at:139;lalr1.cc api.value.type={struct foo};api.value.type c++;
404;types.at:139;lalr1.cc api.value.type={struct foo} %header;api.value.type c++;
405;types.at:139;lalr1.cc api.value.type={struct bar};api.value.type c++;
406;types.at:139;lalr1.cc api.value.type={struct bar} %header;api.value.type c++;
407;types.at:139;lalr1.cc api.value.type={union foo};api.value.type c++;
408;types.at:139;lalr1.cc api.value.type={union foo} %header;api.value.type c++;
409;types.at:139;lalr1.cc %union { float fval; int ival; };;api.value.type c++;
410;types.at:139;lalr1.cc %union { float fval; int ival; }; %header;api.value.type c++;
411;types.at:139;lalr1.cc api.value.type=union;api.value.type c++;
412;types.at:139;lalr1.cc api.value.type=union %header;api.value.type c++;
413;types.at:139;lalr1.cc api.value.type=variant;api.value.type c++;
414;types.at:139;lalr1.cc api.value.type=variant %header;api.value.type c++;
415;types.at:139;lalr1.cc api.value.type=variant;api.value.type c++;
416;types.at:139;lalr1.cc api.value.type=variant %header;api.value.type c++;
417;types.at:139;lalr1.cc api.value.type=variant api.token.constructor;api.value.type c++;
418;types.at:139;lalr1.cc api.value.type=variant api.token.constructor %header;api.value.type c++;
419;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant;api.value.type c++;
420;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant %header;api.value.type c++;
421;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor;api.value.type c++;
422;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor %header;api.value.type c++;
423;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor;api.value.type c++;
424;types.at:139;lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor %header;api.value.type c++;
425;types.at:139;glr.cc api.value.type={double};api.value.type glr c++;
426;types.at:139;glr.cc api.value.type={double} %header;api.value.type glr c++;
427;types.at:139;glr.cc api.value.type={variant};api.value.type glr c++;
428;types.at:139;glr.cc api.value.type={variant} %header;api.value.type glr c++;
429;types.at:139;glr.cc api.value.type={struct foo};api.value.type glr c++;
430;types.at:139;glr.cc api.value.type={struct foo} %header;api.value.type glr c++;
431;types.at:139;glr.cc api.value.type={struct bar};api.value.type glr c++;
432;types.at:139;glr.cc api.value.type={struct bar} %header;api.value.type glr c++;
433;types.at:139;glr.cc api.value.type={union foo};api.value.type glr c++;
434;types.at:139;glr.cc api.value.type={union foo} %header;api.value.type glr c++;
435;types.at:139;glr.cc %union { float fval; int ival; };;api.value.type glr c++;
436;types.at:139;glr.cc %union { float fval; int ival; }; %header;api.value.type glr c++;
437;types.at:139;glr.cc api.value.type=union;api.value.type glr c++;
438;types.at:139;glr.cc api.value.type=union %header;api.value.type glr c++;
439;types.at:139;glr2.cc api.value.type={double};api.value.type glr c++;
440;types.at:139;glr2.cc api.value.type={double} %header;api.value.type glr c++;
441;types.at:139;glr2.cc api.value.type={variant};api.value.type glr c++;
442;types.at:139;glr2.cc api.value.type={variant} %header;api.value.type glr c++;
443;types.at:139;glr2.cc api.value.type={struct foo};api.value.type glr c++;
444;types.at:139;glr2.cc api.value.type={struct foo} %header;api.value.type glr c++;
445;types.at:139;glr2.cc api.value.type={struct bar};api.value.type glr c++;
446;types.at:139;glr2.cc api.value.type={struct bar} %header;api.value.type glr c++;
447;types.at:139;glr2.cc api.value.type={union foo};api.value.type glr c++;
448;types.at:139;glr2.cc api.value.type={union foo} %header;api.value.type glr c++;
449;types.at:139;glr2.cc %union { float fval; int ival; };;api.value.type glr c++;
450;types.at:139;glr2.cc %union { float fval; int ival; }; %header;api.value.type glr c++;
451;types.at:139;glr2.cc api.value.type=union;api.value.type glr c++;
452;types.at:139;glr2.cc api.value.type=union %header;api.value.type glr c++;
453;types.at:377;lalr1.cc: Named %union;;
454;types.at:377;glr.cc: Named %union;;
455;scanner.at:326;Token numbers: yacc.c;;
456;scanner.at:326;Token numbers: yacc.c api.token.raw;;
457;scanner.at:326;Token numbers: glr.c;glr;
458;scanner.at:326;Token numbers: glr.c api.token.raw;glr;
459;scanner.at:326;Token numbers: lalr1.cc;c++;
460;scanner.at:326;Token numbers: lalr1.cc api.token.raw;c++;
461;scanner.at:326;Token numbers: glr.cc;glr c++;
462;scanner.at:326;Token numbers: glr.cc api.token.raw;glr c++;
463;scanner.at:326;Token numbers: glr2.cc;glr c++;
464;scanner.at:326;Token numbers: glr2.cc api.token.raw;glr c++;
465;scanner.at:326;Token numbers: lalr1.d;d;
466;scanner.at:326;Token numbers: lalr1.d api.token.raw;d;
467;scanner.at:326;Token numbers: lalr1.java;java;
468;scanner.at:326;Token numbers: lalr1.java api.token.raw;java;
469;scanner.at:330;Token numbers: lalr1.cc api.token.raw api.value.type=variant api.token.constructor;c++;
470;calc.at:1334;Calculator parse.trace ;;
471;calc.at:1336;Calculator %header ;;
472;calc.at:1337;Calculator %debug %locations ;;
473;calc.at:1338;Calculator %locations api.location.type={Span} ;;
474;calc.at:1340;Calculator %name-prefix \"calc\" ;;
475;calc.at:1341;Calculator %verbose ;;
476;calc.at:1342;Calculator %yacc ;yacc;
477;calc.at:1343;Calculator parse.error=detailed ;;
478;calc.at:1344;Calculator parse.error=verbose ;;
479;calc.at:1346;Calculator api.pure=full %locations ;;
480;calc.at:1347;Calculator api.push-pull=both api.pure=full %locations ;push;
481;calc.at:1348;Calculator parse.error=detailed %locations ;;
482;calc.at:1350;Calculator parse.error=detailed %locations %header api.prefix={calc} %verbose %yacc ;yacc;
483;calc.at:1351;Calculator parse.error=detailed %locations %header %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc ;yacc;
484;calc.at:1353;Calculator %debug ;;
485;calc.at:1354;Calculator parse.error=detailed %debug %locations %header %name-prefix \"calc\" %verbose %yacc ;yacc;
486;calc.at:1355;Calculator parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc ;yacc;
487;calc.at:1357;Calculator api.pure=full parse.error=detailed %debug %locations %header %name-prefix \"calc\" %verbose %yacc ;yacc;
488;calc.at:1358;Calculator api.push-pull=both api.pure=full parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc ;push yacc;
489;calc.at:1360;Calculator api.pure parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} ;yacc;
490;calc.at:1362;Calculator %no-lines api.pure parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} ;yacc;
491;calc.at:1363;Calculator %no-lines api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} ;yacc;
492;calc.at:1364;Calculator %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} ;yacc;
493;calc.at:1367;Calculator parse.error=custom ;;
494;calc.at:1368;Calculator parse.error=custom %locations api.prefix={calc} ;;
495;calc.at:1369;Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} ;;
496;calc.at:1370;Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} api.push-pull=both api.pure=full ;push;
497;calc.at:1371;Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} api.push-pull=both api.pure=full parse.lac=full ;push;
498;calc.at:1374;Calculator %start input exp NUM api.value.type=union ;multistart;
499;calc.at:1375;Calculator %start input exp NUM api.value.type=union %locations parse.error=detailed ;multistart;
500;calc.at:1387;Calculator %glr-parser ;glr;
501;calc.at:1389;Calculator %glr-parser %header ;glr;
502;calc.at:1390;Calculator %glr-parser %locations ;glr;
503;calc.at:1391;Calculator %glr-parser %locations api.location.type={Span} ;glr;
504;calc.at:1392;Calculator %glr-parser %name-prefix \"calc\" ;glr;
505;calc.at:1393;Calculator %glr-parser api.prefix={calc} ;glr;
506;calc.at:1394;Calculator %glr-parser %verbose ;glr;
507;calc.at:1395;Calculator %glr-parser parse.error=verbose ;glr;
508;calc.at:1397;Calculator %glr-parser api.pure %locations ;glr;
509;calc.at:1398;Calculator %glr-parser parse.error=verbose %locations ;glr;
510;calc.at:1400;Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose ;glr;
511;calc.at:1401;Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose api.pure ;glr;
512;calc.at:1402;Calculator %glr-parser parse.error=detailed %locations %header %name-prefix \"calc\" %verbose ;glr;
513;calc.at:1403;Calculator %glr-parser parse.error=verbose %locations %header %name-prefix \"calc\" %verbose ;glr;
514;calc.at:1405;Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose ;glr;
515;calc.at:1407;Calculator %glr-parser %debug ;glr;
516;calc.at:1408;Calculator %glr-parser parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose ;glr;
517;calc.at:1409;Calculator %glr-parser parse.error=verbose %debug %locations %header api.prefix={calc} api.token.prefix={TOK_} %verbose ;glr;
518;calc.at:1411;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose ;glr;
519;calc.at:1413;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr;
520;calc.at:1414;Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr;
521;calc.at:1416;Calculator %glr-parser %no-lines api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr;
522;calc.at:1426;Calculator lalr1.cc %header ;c++;
523;calc.at:1431;Calculator C++ ;c++;
524;calc.at:1432;Calculator C++ %locations ;c++;
525;calc.at:1433;Calculator C++ %locations \$NO_EXCEPTIONS_CXXFLAGS;c++;
526;calc.at:1434;Calculator C++ %locations api.location.type={Span} ;c++;
527;calc.at:1435;Calculator C++ %header %locations parse.error=verbose %name-prefix \"calc\" %verbose ;c++;
528;calc.at:1437;Calculator C++ %locations parse.error=verbose api.prefix={calc} %verbose ;c++;
529;calc.at:1438;Calculator C++ %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose ;c++;
530;calc.at:1440;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} %verbose ;c++;
531;calc.at:1441;Calculator C++ %locations parse.error=verbose %debug api.prefix={calc} api.token.prefix={TOK_} %verbose ;c++;
532;calc.at:1443;Calculator C++ %header %locations parse.error=verbose %debug %name-prefix \"calc\" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;c++;
533;calc.at:1445;Calculator C++ parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;c++;
534;calc.at:1446;Calculator C++ %header %locations parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;c++;
535;calc.at:1448;Calculator C++ %header %locations api.location.file=none ;c++;
536;calc.at:1449;Calculator C++ %header %locations api.location.file=\"my-location.hh\" ;c++;
537;calc.at:1451;Calculator C++ %no-lines %header %locations api.location.file=\"my-location.hh\" ;c++;
538;calc.at:1453;Calculator C++ %locations parse.lac=full parse.error=verbose ;c++;
539;calc.at:1454;Calculator C++ %locations parse.lac=full parse.error=detailed ;c++;
540;calc.at:1455;Calculator C++ %locations parse.lac=full parse.error=detailed parse.trace ;c++;
541;calc.at:1457;Calculator C++ parse.error=custom ;c++;
542;calc.at:1458;Calculator C++ parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} ;c++;
543;calc.at:1459;Calculator C++ parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} parse.lac=full ;c++;
544;calc.at:1468;Calculator glr.cc ;glr c++;
545;calc.at:1469;Calculator glr2.cc ;glr c++;
546;calc.at:1476;Calculator C++ %glr-parser ;glr c++;
547;calc.at:1476;Calculator glr2.cc ;glr c++;
548;calc.at:1477;Calculator C++ %glr-parser %locations ;glr c++;
549;calc.at:1477;Calculator glr2.cc %locations ;glr c++;
550;calc.at:1478;Calculator C++ %glr-parser %locations api.location.type={Span} ;glr c++;
551;calc.at:1478;Calculator glr2.cc %locations api.location.type={Span} ;glr c++;
552;calc.at:1479;Calculator C++ %glr-parser %header parse.error=verbose %name-prefix \"calc\" %verbose ;glr c++;
553;calc.at:1479;Calculator glr2.cc %header parse.error=verbose %name-prefix \"calc\" %verbose ;glr c++;
554;calc.at:1480;Calculator C++ %glr-parser parse.error=verbose api.prefix={calc} %verbose ;glr c++;
555;calc.at:1480;Calculator glr2.cc parse.error=verbose api.prefix={calc} %verbose ;glr c++;
556;calc.at:1482;Calculator C++ %glr-parser %debug ;glr c++;
557;calc.at:1482;Calculator glr2.cc %debug ;glr c++;
558;calc.at:1485;Calculator C++ %glr-parser parse.error=detailed %debug %name-prefix \"calc\" %verbose ;glr c++;
559;calc.at:1485;Calculator glr2.cc parse.error=detailed %debug %name-prefix \"calc\" %verbose ;glr c++;
560;calc.at:1486;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" %verbose ;glr c++;
561;calc.at:1486;Calculator glr2.cc parse.error=verbose %debug %name-prefix \"calc\" %verbose ;glr c++;
562;calc.at:1487;Calculator glr2.cc parse.error=custom %debug %name-prefix \"calc\" %verbose ;glr c++;
563;calc.at:1489;Calculator C++ %glr-parser parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose ;glr c++;
564;calc.at:1489;Calculator glr2.cc parse.error=verbose %debug %name-prefix \"calc\" api.token.prefix={TOK_} %verbose ;glr c++;
565;calc.at:1491;Calculator C++ %glr-parser %locations %header parse.error=verbose %debug %name-prefix \"calc\" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
566;calc.at:1491;Calculator glr2.cc %locations %header parse.error=verbose %debug %name-prefix \"calc\" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
567;calc.at:1492;Calculator C++ %glr-parser %locations %header parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
568;calc.at:1492;Calculator glr2.cc %locations %header parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
569;calc.at:1494;Calculator C++ %glr-parser %no-lines %locations %header parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
570;calc.at:1494;Calculator glr2.cc %no-lines %locations %header parse.error=verbose %debug api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} ;glr c++;
571;calc.at:1504;Calculator lalr1.d ;d;
572;calc.at:1509;Calculator D ;d;
573;calc.at:1510;Calculator D %locations ;d;
574;calc.at:1512;Calculator D parse.error=detailed api.prefix={calc} %verbose ;d;
575;calc.at:1514;Calculator D %debug ;d;
576;calc.at:1516;Calculator D parse.error=custom ;d;
577;calc.at:1517;Calculator D %locations parse.error=custom ;d;
578;calc.at:1518;Calculator D %locations parse.error=detailed ;d;
579;calc.at:1519;Calculator D %locations parse.error=simple ;d;
580;calc.at:1520;Calculator D parse.error=detailed %debug %verbose ;d;
581;calc.at:1521;Calculator D parse.error=detailed %debug api.symbol.prefix={SYMB_} api.token.prefix={TOK_} %verbose ;d;
582;calc.at:1523;Calculator D %locations parse.lac=full parse.error=detailed ;d;
583;calc.at:1524;Calculator D %locations parse.lac=full parse.error=custom ;d;
584;calc.at:1525;Calculator D %locations parse.lac=full parse.error=detailed parse.trace ;d;
585;calc.at:1530;Calculator D api.token.constructor %locations parse.error=custom api.value.type=union ;d;
586;calc.at:1531;Calculator D api.token.constructor %locations parse.error=detailed ;d;
587;calc.at:1532;Calculator D api.push-pull=both ;push d;
588;calc.at:1533;Calculator D parse.trace parse.error=custom %locations api.push-pull=both parse.lac=full ;push d;
589;calc.at:1544;Calculator Java ;java;
590;calc.at:1545;Calculator Java parse.error=custom ;java;
591;calc.at:1546;Calculator Java parse.error=detailed ;java;
592;calc.at:1547;Calculator Java parse.error=verbose ;java;
593;calc.at:1548;Calculator Java %locations parse.error=custom ;java;
594;calc.at:1549;Calculator Java %locations parse.error=detailed ;java;
595;calc.at:1550;Calculator Java %locations parse.error=verbose ;java;
596;calc.at:1551;Calculator Java parse.trace parse.error=verbose ;java;
597;calc.at:1552;Calculator Java parse.trace parse.error=verbose %locations %lex-param {InputStream is} ;java;
598;calc.at:1554;Calculator Java api.push-pull=both ;push java;
599;calc.at:1555;Calculator Java api.push-pull=both parse.error=detailed %locations ;push java;
600;calc.at:1556;Calculator Java parse.trace parse.error=custom %locations %lex-param {InputStream is} api.push-pull=both ;push java;
601;calc.at:1557;Calculator Java parse.trace parse.error=verbose %locations %lex-param {InputStream is} api.push-pull=both ;push java;
602;calc.at:1560;Calculator Java parse.trace parse.error=custom %locations parse.lac=full ;java;
603;calc.at:1561;Calculator Java parse.trace parse.error=custom %locations api.push-pull=both parse.lac=full ;push java;
604;torture.at:132;Big triangle;;
605;torture.at:216;Big horizontal;;
606;torture.at:270;State number type: 128 states;;
607;torture.at:271;State number type: 129 states;;
608;torture.at:272;State number type: 256 states;;
609;torture.at:273;State number type: 257 states;;
610;torture.at:274;State number type: 32768 states;;
611;torture.at:275;State number type: 65536 states;;
612;torture.at:276;State number type: 65537 states;;
613;torture.at:385;Many lookahead tokens;;
614;torture.at:485;Exploding the Stack Size with Alloca;push;
615;torture.at:531;Exploding the Stack Size with Malloc;push;
616;existing.at:74;GNU AWK 3.1.0 Grammar: LALR(1);;
617;existing.at:74;GNU AWK 3.1.0 Grammar: IELR(1);;
618;existing.at:74;GNU AWK 3.1.0 Grammar: Canonical LR(1);;
619;existing.at:808;GNU Cim Grammar: LALR(1);;
620;existing.at:808;GNU Cim Grammar: IELR(1);;
621;existing.at:808;GNU Cim Grammar: Canonical LR(1);;
622;existing.at:1460;GNU pic (Groff 1.18.1) Grammar: LALR(1);;
623;existing.at:1460;GNU pic (Groff 1.18.1) Grammar: IELR(1);;
624;existing.at:1460;GNU pic (Groff 1.18.1) Grammar: Canonical LR(1);;
625;regression.at:25;Trivial grammars;;
626;regression.at:55;YYSTYPE typedef;;
627;regression.at:85;Early token definitions with --yacc;yacc;
628;regression.at:127;Early token definitions without --yacc;;
629;regression.at:173;Braces parsing;;
630;regression.at:196;Rule Line Numbers;report;
631;regression.at:345;Mixing %token styles;;
632;regression.at:437;Token definitions: parse.error=detailed;;
633;regression.at:438;Token definitions: parse.error=verbose;;
634;regression.at:447;Characters Escapes;;
635;regression.at:480;Web2c Report;report;
636;regression.at:661;Web2c Actions;report;
637;regression.at:812;Useless Tokens;;
638;regression.at:1143;Dancer ;;
639;regression.at:1144;Dancer %glr-parser;glr;
640;regression.at:1145;Dancer lalr1.cc;c++;
641;regression.at:1220;Expecting two tokens ;;
642;regression.at:1221;Expecting two tokens %glr-parser;glr;
643;regression.at:1222;Expecting two tokens lalr1.cc;c++;
644;regression.at:1230;Braced code in declaration in rules section;;
645;regression.at:1291;String alias declared after use;;
646;regression.at:1314;Extra lookahead sets in report;;
647;regression.at:1355;Token number in precedence declaration;;
648;regression.at:1408;parse-gram.y: LALR = IELR;;
649;regression.at:1430;parse.error=verbose and YYSTACK_USE_ALLOCA;;
650;regression.at:1504;parse.error=verbose overflow;;
651;regression.at:1628;LAC: Exploratory stack;lac push c++ java;
652;regression.at:1739;LAC: Memory exhaustion;lac;
653;regression.at:1874;Lex and parse params: yacc.c;;
654;regression.at:1875;Lex and parse params: glr.c;glr;
655;regression.at:1876;Lex and parse params: lalr1.cc;c++;
656;regression.at:1877;Lex and parse params: glr.cc;glr c++;
657;regression.at:1878;Lex and parse params: glr2.cc;glr c++;
658;regression.at:1889;stdio.h is not needed;;
659;push.at:25;Memory Leak for Early Deletion;;
660;push.at:84;Multiple impure instances;;
661;push.at:145;Unsupported Skeletons;;
662;push.at:167;Pstate reuse;;
663;c++.at:26;C++ Locations Unit Tests;c++;
664;c++.at:107;C++ Variant-based Symbols Unit Tests;variant c++;
665;c++.at:247;Multiple occurrences of \$n and api.value.automove;;
666;c++.at:566;Variants lalr1.cc;variant c++;
667;c++.at:567;Variants lalr1.cc parse.assert;variant c++;
668;c++.at:568;Variants lalr1.cc parse.assert api.value.automove;variant c++;
669;c++.at:569;Variants lalr1.cc parse.assert %locations;variant c++;
670;c++.at:570;Variants lalr1.cc parse.assert %code {\\n#define TWO_STAGE_BUILD\\n};variant c++;
671;c++.at:571;Variants lalr1.cc parse.assert api.token.constructor;variant c++;
672;c++.at:572;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_};variant c++;
673;c++.at:573;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations;variant c++;
674;c++.at:574;Variants lalr1.cc parse.assert api.token.constructor api.token.prefix={TOK_} %locations api.value.automove;variant c++;
675;c++.at:584;Variants and Typed Midrule Actions;c++;
676;c++.at:794;Doxygen Public Documentation;;
677;c++.at:795;Doxygen Private Documentation;;
678;c++.at:848;Relative namespace references;c++;
679;c++.at:854;Absolute namespace references;c++;
680;c++.at:863;Syntactically invalid namespace references;;
681;c++.at:884;Syntax error discarding no lookahead;c++;
682;c++.at:1064;Syntax error as exception: lalr1.cc;c++;
683;c++.at:1065;Syntax error as exception: glr.cc;glr c++;
684;c++.at:1066;Syntax error as exception: glr2.cc;glr c++;
685;c++.at:1360;Exception safety with error recovery ;c++;
686;c++.at:1361;Exception safety without error recovery ;c++;
687;c++.at:1362;Exception safety with error recovery api.value.type=variant;c++;
688;c++.at:1363;Exception safety without error recovery api.value.type=variant;c++;
689;c++.at:1371;C++ GLR parser identifier shadowing;glr c++;
690;c++.at:1422;Shared locations;c++;
691;c++.at:1517;Default action;action c++;
692;java.at:25;Java invalid directives;;
693;java.at:186;Java parser class and package names;java;
694;java.at:217;Java parser class modifiers;java;
695;java.at:287;Java parser class extends and implements;java;
696;java.at:307;Java %parse-param and %lex-param;java;
697;java.at:381;Java throws specifications;java;
698;java.at:470;Java constructor init and init_throws;java;
699;java.at:497;Java value, position, and location types;java;
700;java.at:528;Java syntax error handling without error token;java;
701;javapush.at:172;Trivial Push Parser with api.push-pull verification;java;
702;javapush.at:217;Trivial Push Parser with %initial-action;java;
703;d.at:103;D parser class extends and implements;d;
704;d.at:138;D parser class api.token.raw true by default;d;
705;cxx-type.at:409;GLR: Resolve ambiguity, impure, no locations;glr;
706;cxx-type.at:415;GLR: Resolve ambiguity, impure, locations;glr;
707;cxx-type.at:420;GLR: Resolve ambiguity, pure, no locations;glr;
708;cxx-type.at:426;GLR: Resolve ambiguity, pure, locations;glr;
709;cxx-type.at:432;GLR: Merge conflicting parses, impure, no locations;glr;
710;cxx-type.at:438;GLR: Merge conflicting parses, impure, locations;glr;
711;cxx-type.at:444;GLR: Merge conflicting parses, pure, no locations;glr;
712;cxx-type.at:449;GLR: Merge conflicting parses, pure, locations;glr;
713;cxx-type.at:455;GLR: Verbose messages, resolve ambiguity, impure, no locations;glr;
714;glr-regression.at:205;Badly Collapsed GLR States: glr.c;glr %merge;
715;glr-regression.at:206;Badly Collapsed GLR States: glr.cc;glr %merge c++;
716;glr-regression.at:207;Badly Collapsed GLR States: glr2.cc;glr %merge c++;
717;glr-regression.at:354;Improper handling of embedded actions and dollar(-N) in GLR parsers: glr.c;glr;
718;glr-regression.at:355;Improper handling of embedded actions and dollar(-N) in GLR parsers: glr.cc;glr c++;
719;glr-regression.at:356;Improper handling of embedded actions and dollar(-N) in GLR parsers: glr2.cc;glr c++;
720;glr-regression.at:488;Improper merging of GLR delayed action sets: glr.c;%merge glr;
721;glr-regression.at:489;Improper merging of GLR delayed action sets: glr.cc;%merge glr c++;
722;glr-regression.at:490;Improper merging of GLR delayed action sets: glr2.cc;%merge glr c++;
723;glr-regression.at:592;Duplicate representation of merged trees: %union { char *ptr; } glr.c;%merge glr;
724;glr-regression.at:593;Duplicate representation of merged trees: %union { char *ptr; } glr.cc;%merge glr c++;
725;glr-regression.at:594;Duplicate representation of merged trees: %union { char *ptr; } glr2.cc;%merge glr c++;
726;glr-regression.at:596;Duplicate representation of merged trees: api.value.type=union glr.c;%merge glr;
727;glr-regression.at:597;Duplicate representation of merged trees: api.value.type=union glr.cc;%merge glr c++;
728;glr-regression.at:598;Duplicate representation of merged trees: api.value.type=union glr2.cc;%merge glr c++;
729;glr-regression.at:670;User destructor for unresolved GLR semantic value: glr.c;glr;
730;glr-regression.at:671;User destructor for unresolved GLR semantic value: glr.cc;glr c++;
731;glr-regression.at:672;User destructor for unresolved GLR semantic value: glr2.cc;glr c++;
732;glr-regression.at:738;User destructor after an error during a split parse: glr.c;glr;
733;glr-regression.at:739;User destructor after an error during a split parse: glr.cc;glr c++;
734;glr-regression.at:740;User destructor after an error during a split parse: glr2.cc;glr c++;
735;glr-regression.at:843;Duplicated user destructor for lookahead: glr.c;glr;
736;glr-regression.at:844;Duplicated user destructor for lookahead: glr.cc;glr c++;
737;glr-regression.at:845;Duplicated user destructor for lookahead: glr2.cc;glr c++;
738;glr-regression.at:944;Incorrectly initialized location for empty right-hand side in GLR: glr.c;glr;
739;glr-regression.at:945;Incorrectly initialized location for empty right-hand side in GLR: glr.cc;glr c++;
740;glr-regression.at:946;Incorrectly initialized location for empty right-hand side in GLR: glr2.cc;glr c++;
741;glr-regression.at:1036;No users destructors if stack 0 deleted: glr.c;glr;
742;glr-regression.at:1037;No users destructors if stack 0 deleted: glr.cc;glr c++;
743;glr-regression.at:1038;No users destructors if stack 0 deleted: glr2.cc;glr c++;
744;glr-regression.at:1102;Corrupted semantic options if user action cuts parse: glr.c;glr;
745;glr-regression.at:1103;Corrupted semantic options if user action cuts parse: glr.cc;glr c++;
746;glr-regression.at:1104;Corrupted semantic options if user action cuts parse: glr2.cc;glr c++;
747;glr-regression.at:1174;Undesirable destructors if user action cuts parse: glr.c;glr;
748;glr-regression.at:1175;Undesirable destructors if user action cuts parse: glr.cc;glr c++;
749;glr-regression.at:1176;Undesirable destructors if user action cuts parse: glr2.cc;glr c++;
750;glr-regression.at:1310;Leaked semantic values if user action cuts parse: glr.c;%merge glr;
751;glr-regression.at:1311;Leaked semantic values if user action cuts parse: glr.cc;%merge glr c++;
752;glr-regression.at:1312;Leaked semantic values if user action cuts parse: glr2.cc;%merge glr c++;
753;glr-regression.at:1445;Incorrect lookahead during deterministic GLR: glr.c;glr;
754;glr-regression.at:1446;Incorrect lookahead during deterministic GLR: glr.cc;glr c++;
755;glr-regression.at:1447;Incorrect lookahead during deterministic GLR: glr2.cc;glr c++;
756;glr-regression.at:1678;Incorrect lookahead during nondeterministic GLR: glr.c;%merge glr;
757;glr-regression.at:1679;Incorrect lookahead during nondeterministic GLR: glr.cc;%merge glr c++;
758;glr-regression.at:1680;Incorrect lookahead during nondeterministic GLR: glr2.cc;%merge glr c++;
759;glr-regression.at:1785;Leaked semantic values when reporting ambiguity: glr.c;glr;
760;glr-regression.at:1786;Leaked semantic values when reporting ambiguity: glr.cc;glr c++;
761;glr-regression.at:1787;Leaked semantic values when reporting ambiguity: glr2.cc;glr c++;
762;glr-regression.at:1860;Leaked lookahead after nondeterministic parse syntax error: glr.c;glr;
763;glr-regression.at:1861;Leaked lookahead after nondeterministic parse syntax error: glr.cc;glr c++;
764;glr-regression.at:1862;Leaked lookahead after nondeterministic parse syntax error: glr2.cc;glr c++;
765;glr-regression.at:1964;Uninitialized location when reporting ambiguity: glr.c api.pure;glr;
766;glr-regression.at:1965;Uninitialized location when reporting ambiguity: glr.cc;glr c++;
767;glr-regression.at:1966;Uninitialized location when reporting ambiguity: glr2.cc;glr c++;
768;glr-regression.at:2035;Missed %merge type warnings when LHS type is declared later: glr.c;%merge glr;
769;glr-regression.at:2036;Missed %merge type warnings when LHS type is declared later: glr.cc;%merge glr;
770;glr-regression.at:2037;Missed %merge type warnings when LHS type is declared later: glr2.cc;%merge glr;
771;glr-regression.at:2149;Ambiguity reports: glr.c;glr;
772;glr-regression.at:2150;Ambiguity reports: glr.cc;glr c++;
773;glr-regression.at:2151;Ambiguity reports: glr2.cc;glr c++;
774;glr-regression.at:2229;Predicates: glr.c;glr;
775;glr-regression.at:2230;Predicates: glr.cc;glr c++;
776;glr-regression.at:2231;Predicates: glr2.cc;glr c++;
"
# List of the all the test groups.
at_groups_all=`printf "%s\n" "$at_help_all" | sed 's/;.*//'`
# at_fn_validate_ranges NAME...
# -----------------------------
# Validate and normalize the test group number contained in each variable
# NAME. Leading zeroes are treated as decimal.
at_fn_validate_ranges ()
{
for at_grp
do
eval at_value=\$$at_grp
if test $at_value -lt 1 || test $at_value -gt 776; then
printf "%s\n" "invalid test group: $at_value" >&2
exit 1
fi
case $at_value in
0*) # We want to treat leading 0 as decimal, like expr and test, but
# AS_VAR_ARITH treats it as octal if it uses $(( )).
# With XSI shells, ${at_value#${at_value%%[1-9]*}} avoids the
# expr fork, but it is not worth the effort to determine if the
# shell supports XSI when the user can just avoid leading 0.
eval $at_grp='`expr $at_value + 0`' ;;
esac
done
}
# List of the tested programs.
at_tested='"bison"'
##
## Set up package specific options.
##
at_arg_compile_c_with_cxx=false
at_arg_given_compile_c_with_cxx=false
at_prev=
for at_option
do
# If the previous option needs an argument, assign it.
if test -n "$at_prev"; then
at_option=$at_prev=$at_option
at_prev=
fi
case $at_option in
*=?*) at_optarg=`expr "X$at_option" : '[^=]*=\(.*\)'` ;;
*) at_optarg= ;;
esac
case $at_option in
--help | -h )
at_help_p=:
;;
--list | -l )
at_list_p=:
;;
--version | -V )
at_version_p=:
;;
--clean | -c )
at_clean=:
;;
--color )
at_color=always
;;
--color=* )
case $at_optarg in
no | never | none) at_color=never ;;
auto | tty | if-tty) at_color=auto ;;
always | yes | force) at_color=always ;;
*) at_optname=`echo " $at_option" | sed 's/^ //; s/=.*//'`
as_fn_error $? "unrecognized argument to $at_optname: $at_optarg" ;;
esac
;;
--debug | -d )
at_debug_p=:
;;
--errexit | -e )
at_debug_p=:
at_errexit_p=:
;;
--verbose | -v )
at_verbose=; at_quiet=:
;;
--trace | -x )
at_traceon='set -x'
at_trace_echo=echo
at_check_filter_trace=at_fn_filter_trace
;;
[0-9] | [0-9][0-9] | [0-9][0-9][0-9] | [0-9][0-9][0-9][0-9])
at_fn_validate_ranges at_option
as_fn_append at_groups "$at_option$as_nl"
;;
# Ranges
[0-9]- | [0-9][0-9]- | [0-9][0-9][0-9]- | [0-9][0-9][0-9][0-9]-)
at_range_start=`echo $at_option |tr -d X-`
at_fn_validate_ranges at_range_start
at_range=`printf "%s\n" "$at_groups_all" | \
sed -ne '/^'$at_range_start'$/,$p'`
as_fn_append at_groups "$at_range$as_nl"
;;
-[0-9] | -[0-9][0-9] | -[0-9][0-9][0-9] | -[0-9][0-9][0-9][0-9])
at_range_end=`echo $at_option |tr -d X-`
at_fn_validate_ranges at_range_end
at_range=`printf "%s\n" "$at_groups_all" | \
sed -ne '1,/^'$at_range_end'$/p'`
as_fn_append at_groups "$at_range$as_nl"
;;
[0-9]-[0-9] | [0-9]-[0-9][0-9] | [0-9]-[0-9][0-9][0-9] | \
[0-9]-[0-9][0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9] | \
[0-9][0-9]-[0-9][0-9][0-9] | [0-9][0-9]-[0-9][0-9][0-9][0-9] | \
[0-9][0-9][0-9]-[0-9][0-9][0-9] | \
[0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] | \
[0-9][0-9][0-9][0-9]-[0-9][0-9][0-9][0-9] )
at_range_start=`expr $at_option : '\(.*\)-'`
at_range_end=`expr $at_option : '.*-\(.*\)'`
if test $at_range_start -gt $at_range_end; then
at_tmp=$at_range_end
at_range_end=$at_range_start
at_range_start=$at_tmp
fi
at_fn_validate_ranges at_range_start at_range_end
at_range=`printf "%s\n" "$at_groups_all" | \
sed -ne '/^'$at_range_start'$/,/^'$at_range_end'$/p'`
as_fn_append at_groups "$at_range$as_nl"
;;
# Directory selection.
--directory | -C )
at_prev=--directory
;;
--directory=* )
at_change_dir=:
at_dir=$at_optarg
if test x- = "x$at_dir" ; then
at_dir=./-
fi
;;
# Parallel execution.
--jobs | -j )
at_jobs=0
;;
--jobs=* | -j[0-9]* )
if test -n "$at_optarg"; then
at_jobs=$at_optarg
else
at_jobs=`expr X$at_option : 'X-j\(.*\)'`
fi
case $at_jobs in *[!0-9]*)
at_optname=`echo " $at_option" | sed 's/^ //; s/[0-9=].*//'`
as_fn_error $? "non-numeric argument to $at_optname: $at_jobs" ;;
esac
;;
# Keywords.
--keywords | -k )
at_prev=--keywords
;;
--keywords=* )
at_groups_selected=$at_help_all
at_save_IFS=$IFS
IFS=,
set X $at_optarg
shift
IFS=$at_save_IFS
for at_keyword
do
at_invert=
case $at_keyword in
'!'*)
at_invert="-v"
at_keyword=`expr "X$at_keyword" : 'X!\(.*\)'`
;;
esac
# It is on purpose that we match the test group titles too.
at_groups_selected=`printf "%s\n" "$at_groups_selected" |
grep -i $at_invert "^[1-9][^;]*;.*[; ]$at_keyword[ ;]"`
done
# Smash the keywords.
at_groups_selected=`printf "%s\n" "$at_groups_selected" | sed 's/;.*//'`
as_fn_append at_groups "$at_groups_selected$as_nl"
;;
--recheck)
at_recheck=:
;;
--compile-c-with-cxx )
at_optarg=:
at_arg_compile_c_with_cxx=:
at_arg_given_compile_c_with_cxx=:
;;
--no-compile-c-with-cxx )
at_optarg=false
at_arg_compile_c_with_cxx=false
at_arg_given_compile_c_with_cxx=:
;;
*=*)
at_envvar=`expr "x$at_option" : 'x\([^=]*\)='`
# Reject names that are not valid shell variable names.
case $at_envvar in
'' | [0-9]* | *[!_$as_cr_alnum]* )
as_fn_error $? "invalid variable name: \`$at_envvar'" ;;
esac
at_value=`printf "%s\n" "$at_optarg" | sed "s/'/'\\\\\\\\''/g"`
# Export now, but save eval for later and for debug scripts.
export $at_envvar
as_fn_append at_debug_args " $at_envvar='$at_value'"
;;
*) printf "%s\n" "$as_me: invalid option: $at_option" >&2
printf "%s\n" "Try \`$0 --help' for more information." >&2
exit 1
;;
esac
done
# Verify our last option didn't require an argument
if test -n "$at_prev"
then :
as_fn_error $? "\`$at_prev' requires an argument"
fi
# The file containing the suite.
at_suite_log=$at_dir/$as_me.log
# Selected test groups.
if test -z "$at_groups$at_recheck"; then
at_groups=$at_groups_all
else
if test -n "$at_recheck" && test -r "$at_suite_log"; then
at_oldfails=`sed -n '
/^Failed tests:$/,/^Skipped tests:$/{
s/^[ ]*\([1-9][0-9]*\):.*/\1/p
}
/^Unexpected passes:$/,/^## Detailed failed tests/{
s/^[ ]*\([1-9][0-9]*\):.*/\1/p
}
/^## Detailed failed tests/q
' "$at_suite_log"`
as_fn_append at_groups "$at_oldfails$as_nl"
fi
# Sort the tests, removing duplicates.
at_groups=`printf "%s\n" "$at_groups" | sort -nu | sed '/^$/d'`
fi
if test x"$at_color" = xalways \
|| { test x"$at_color" = xauto && test -t 1; }; then
at_red=`printf '\033[0;31m'`
at_grn=`printf '\033[0;32m'`
at_lgn=`printf '\033[1;32m'`
at_blu=`printf '\033[1;34m'`
at_std=`printf '\033[m'`
else
at_red= at_grn= at_lgn= at_blu= at_std=
fi
# Help message.
if $at_help_p; then
cat <<_ATEOF || at_write_fail=1
Usage: $0 [OPTION]... [VARIABLE=VALUE]... [TESTS]
Run all the tests, or the selected TESTS, given by numeric ranges, and
save a detailed log file. Upon failure, create debugging scripts.
Do not change environment variables directly. Instead, set them via
command line arguments. Set \`AUTOTEST_PATH' to select the executables
to exercise. Each relative directory is expanded as build and source
directories relative to the top level of this distribution.
E.g., from within the build directory /tmp/foo-1.0, invoking this:
$ $0 AUTOTEST_PATH=bin
is equivalent to the following, assuming the source directory is /src/foo-1.0:
PATH=/tmp/foo-1.0/bin:/src/foo-1.0/bin:\$PATH $0
_ATEOF
cat <<_ATEOF || at_write_fail=1
Operation modes:
-h, --help print the help message, then exit
-V, --version print version number, then exit
-c, --clean remove all the files this test suite might create and exit
-l, --list describes all the tests, or the selected TESTS
_ATEOF
cat <<_ATEOF || at_write_fail=1
Execution tuning:
-C, --directory=DIR
change to directory DIR before starting
--color[=never|auto|always]
disable colored test results, or enable even without terminal
-j, --jobs[=N]
Allow N jobs at once; infinite jobs with no arg (default 1)
-k, --keywords=KEYWORDS
select the tests matching all the comma-separated KEYWORDS
multiple \`-k' accumulate; prefixed \`!' negates a KEYWORD
--recheck select all tests that failed or passed unexpectedly last time
-e, --errexit abort as soon as a test fails; implies --debug
-v, --verbose force more detailed output
default for debugging scripts
-d, --debug inhibit clean up and top-level logging
default for debugging scripts
-x, --trace enable tests shell tracing
_ATEOF
cat <<_ATEOF || at_write_fail=1
Other options:
_ATEOF
cat <<_ATEOF || at_write_fail=1
compile C parsers with the C++ compiler
_ATEOF
cat <<_ATEOF || at_write_fail=1
Report bugs to <bug-bison@gnu.org>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
_ATEOF
exit $at_write_fail
fi
# List of tests.
if $at_list_p; then
cat <<_ATEOF || at_write_fail=1
GNU Bison 3.8.2 test suite test groups:
NUM: FILE-NAME:LINE TEST-GROUP-NAME
KEYWORDS
_ATEOF
# Pass an empty line as separator between selected groups and help.
printf "%s\n" "$at_groups$as_nl$as_nl$at_help_all" |
awk 'NF == 1 && FS != ";" {
selected[$ 1] = 1
next
}
/^$/ { FS = ";" }
NF > 0 {
if (selected[$ 1]) {
printf " %3d: %-18s %s\n", $ 1, $ 2, $ 3
if ($ 4) {
lmax = 79
indent = " "
line = indent
len = length (line)
n = split ($ 4, a, " ")
for (i = 1; i <= n; i++) {
l = length (a[i]) + 1
if (i > 1 && len + l > lmax) {
print line
line = indent " " a[i]
len = length (line)
} else {
line = line " " a[i]
len += l
}
}
if (n)
print line
}
}
}' || at_write_fail=1
exit $at_write_fail
fi
if $at_version_p; then
printf "%s\n" "$as_me (GNU Bison 3.8.2)" &&
cat <<\_ATEOF || at_write_fail=1
Copyright (C) 2021 Free Software Foundation, Inc.
This test suite is free software; the Free Software Foundation gives
unlimited permission to copy, distribute and modify it.
_ATEOF
exit $at_write_fail
fi
# Should we print banners? Yes if more than one test is run.
case $at_groups in #(
*$as_nl* )
at_print_banners=: ;; #(
* ) at_print_banners=false ;;
esac
# Text for banner N, set to a single space once printed.
# Banner 1. m4.at:18
# Category starts at test group 1.
at_banner_text_1="M4 Macros."
# Banner 2. input.at:18
# Category starts at test group 2.
at_banner_text_2="Input Processing."
# Banner 3. named-refs.at:19
# Category starts at test group 71.
at_banner_text_3="Named references tests."
# Banner 4. output.at:19
# Category starts at test group 83.
at_banner_text_4="Output file names."
# Banner 5. diagnostics.at:18
# Category starts at test group 145.
at_banner_text_5="Diagnostics."
# Banner 6. skeletons.at:19
# Category starts at test group 162.
at_banner_text_6="Skeleton Support."
# Banner 7. sets.at:20
# Category starts at test group 168.
at_banner_text_7="Grammar Sets (Firsts etc.)."
# Banner 8. reduce.at:19
# Category starts at test group 175.
at_banner_text_8="Grammar Reduction."
# Banner 9. report.at:18
# Category starts at test group 202.
at_banner_text_9="Test reports."
# Banner 10. conflicts.at:19
# Category starts at test group 204.
at_banner_text_10="Conflicts."
# Banner 11. counterexample.at:18
# Category starts at test group 259.
at_banner_text_11="Counterexamples."
# Banner 12. synclines.at:19
# Category starts at test group 274.
at_banner_text_12="Sync Lines."
# Banner 13. headers.at:19
# Category starts at test group 294.
at_banner_text_13="Parser Headers."
# Banner 14. actions.at:18
# Category starts at test group 311.
at_banner_text_14="User Actions."
# Banner 15. types.at:18
# Category starts at test group 361.
at_banner_text_15="Value type tests."
# Banner 16. scanner.at:18
# Category starts at test group 455.
at_banner_text_16="Interface with the scanner."
# Banner 17. calc.at:1325
# Category starts at test group 470.
at_banner_text_17="LALR(1) Calculator."
# Banner 18. calc.at:1382
# Category starts at test group 500.
at_banner_text_18="GLR Calculator."
# Banner 19. calc.at:1423
# Category starts at test group 522.
at_banner_text_19="LALR(1) C++ Calculator."
# Banner 20. calc.at:1465
# Category starts at test group 544.
at_banner_text_20="GLR C++ Calculator."
# Banner 21. calc.at:1501
# Category starts at test group 571.
at_banner_text_21="LALR(1) D Calculator."
# Banner 22. calc.at:1539
# Category starts at test group 589.
at_banner_text_22="LALR(1) Java Calculator."
# Banner 23. torture.at:19
# Category starts at test group 604.
at_banner_text_23="Torture Tests."
# Banner 24. existing.at:19
# Category starts at test group 616.
at_banner_text_24="Existing Grammars."
# Banner 25. regression.at:18
# Category starts at test group 625.
at_banner_text_25="Regression tests."
# Banner 26. push.at:19
# Category starts at test group 659.
at_banner_text_26="Push Parsing Tests"
# Banner 27. c++.at:19
# Category starts at test group 663.
at_banner_text_27="C++ Features."
# Banner 28. java.at:18
# Category starts at test group 692.
at_banner_text_28="Java Calculator."
# Banner 29. java.at:113
# Category starts at test group 693.
at_banner_text_29="Java Parameters."
# Banner 30. javapush.at:42
# Category starts at test group 701.
at_banner_text_30="Java Push Parsing Tests"
# Banner 31. d.at:18
# Category starts at test group 703.
at_banner_text_31="D Features."
# Banner 32. cxx-type.at:18
# Category starts at test group 705.
at_banner_text_32="C++ Type Syntax (GLR)."
# Banner 33. glr-regression.at:19
# Category starts at test group 714.
at_banner_text_33="GLR Regression Tests"
# Take any -C into account.
if $at_change_dir ; then
test x != "x$at_dir" && cd "$at_dir" \
|| as_fn_error $? "unable to change directory"
at_dir=`pwd`
fi
# Load the config files for any default variable assignments.
for at_file in atconfig atlocal
do
test -r $at_file || continue
. ./$at_file || as_fn_error $? "invalid content: $at_file"
done
# Autoconf <=2.59b set at_top_builddir instead of at_top_build_prefix:
: "${at_top_build_prefix=$at_top_builddir}"
# Perform any assignments requested during argument parsing.
eval "$at_debug_args"
# atconfig delivers names relative to the directory the test suite is
# in, but the groups themselves are run in testsuite-dir/group-dir.
if test -n "$at_top_srcdir"; then
builddir=../..
for at_dir_var in srcdir top_srcdir top_build_prefix
do
eval at_val=\$at_$at_dir_var
case $at_val in
[\\/$]* | ?:[\\/]* ) at_prefix= ;;
*) at_prefix=../../ ;;
esac
eval "$at_dir_var=\$at_prefix\$at_val"
done
fi
## -------------------- ##
## Directory structure. ##
## -------------------- ##
# This is the set of directories and files used by this script
# (non-literals are capitalized):
#
# TESTSUITE - the testsuite
# TESTSUITE.log - summarizes the complete testsuite run
# TESTSUITE.dir/ - created during a run, remains after -d or failed test
# + at-groups/ - during a run: status of all groups in run
# | + NNN/ - during a run: meta-data about test group NNN
# | | + check-line - location (source file and line) of current AT_CHECK
# | | + status - exit status of current AT_CHECK
# | | + stdout - stdout of current AT_CHECK
# | | + stder1 - stderr, including trace
# | | + stderr - stderr, with trace filtered out
# | | + test-source - portion of testsuite that defines group
# | | + times - timestamps for computing duration
# | | + pass - created if group passed
# | | + xpass - created if group xpassed
# | | + fail - created if group failed
# | | + xfail - created if group xfailed
# | | + skip - created if group skipped
# + at-stop - during a run: end the run if this file exists
# + at-source-lines - during a run: cache of TESTSUITE line numbers for extraction
# + 0..NNN/ - created for each group NNN, remains after -d or failed test
# | + TESTSUITE.log - summarizes the group results
# | + ... - files created during the group
# The directory the whole suite works in.
# Should be absolute to let the user `cd' at will.
at_suite_dir=$at_dir/$as_me.dir
# The file containing the suite ($at_dir might have changed since earlier).
at_suite_log=$at_dir/$as_me.log
# The directory containing helper files per test group.
at_helper_dir=$at_suite_dir/at-groups
# Stop file: if it exists, do not start new jobs.
at_stop_file=$at_suite_dir/at-stop
# The fifo used for the job dispatcher.
at_job_fifo=$at_suite_dir/at-job-fifo
if $at_clean; then
test -d "$at_suite_dir" &&
find "$at_suite_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
rm -f -r "$at_suite_dir" "$at_suite_log"
exit $?
fi
# Don't take risks: use only absolute directories in PATH.
#
# For stand-alone test suites (ie. atconfig was not found),
# AUTOTEST_PATH is relative to `.'.
#
# For embedded test suites, AUTOTEST_PATH is relative to the top level
# of the package. Then expand it into build/src parts, since users
# may create executables in both places.
AUTOTEST_PATH=`printf "%s\n" "$AUTOTEST_PATH" | sed "s|:|$PATH_SEPARATOR|g"`
at_path=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $AUTOTEST_PATH $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -n "$at_path" && as_fn_append at_path $PATH_SEPARATOR
case $as_dir in
[\\/]* | ?:[\\/]* )
as_fn_append at_path "$as_dir"
;;
* )
if test -z "$at_top_build_prefix"; then
# Stand-alone test suite.
as_fn_append at_path "$as_dir"
else
# Embedded test suite.
as_fn_append at_path "$at_top_build_prefix$as_dir$PATH_SEPARATOR"
as_fn_append at_path "$at_top_srcdir/$as_dir"
fi
;;
esac
done
IFS=$as_save_IFS
# Now build and simplify PATH.
#
# There might be directories that don't exist, but don't redirect
# builtins' (eg., cd) stderr directly: Ultrix's sh hates that.
at_new_path=
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $at_path
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -d "$as_dir" || continue
case $as_dir in
[\\/]* | ?:[\\/]* ) ;;
* ) as_dir=`(cd "$as_dir" && pwd) 2>/dev/null` ;;
esac
case $PATH_SEPARATOR$at_new_path$PATH_SEPARATOR in
*$PATH_SEPARATOR$as_dir$PATH_SEPARATOR*) ;;
$PATH_SEPARATOR$PATH_SEPARATOR) at_new_path=$as_dir ;;
*) as_fn_append at_new_path "$PATH_SEPARATOR$as_dir" ;;
esac
done
IFS=$as_save_IFS
PATH=$at_new_path
export PATH
# Setting up the FDs.
# 5 is the log file. Not to be overwritten if `-d'.
if $at_debug_p; then
at_suite_log=/dev/null
else
: >"$at_suite_log"
fi
exec 5>>"$at_suite_log"
# Banners and logs.
printf "%s\n" "## --------------------------- ##
## GNU Bison 3.8.2 test suite. ##
## --------------------------- ##"
{
printf "%s\n" "## --------------------------- ##
## GNU Bison 3.8.2 test suite. ##
## --------------------------- ##"
echo
printf "%s\n" "$as_me: command line was:"
printf "%s\n" " \$ $0 $at_cli_args"
echo
# If ChangeLog exists, list a few lines in case it might help determining
# the exact version.
if test -n "$at_top_srcdir" && test -f "$at_top_srcdir/ChangeLog"; then
printf "%s\n" "## ---------- ##
## ChangeLog. ##
## ---------- ##"
echo
sed 's/^/| /;10q' "$at_top_srcdir/ChangeLog"
echo
fi
{
cat <<_ASUNAME
## --------- ##
## Platform. ##
## --------- ##
hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown`
/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown`
/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown`
/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown`
_ASUNAME
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
printf "%s\n" "PATH: $as_dir"
done
IFS=$as_save_IFS
}
echo
# Contents of the config files.
for at_file in atconfig atlocal
do
test -r $at_file || continue
printf "%s\n" "$as_me: $at_file:"
sed 's/^/| /' $at_file
echo
done
} >&5
at_save_special_files ()
{
for at_save_file in stderr experr expout
do
test ! -f at-bison-check-$at_save_file.bak ||
as_fn_error 1 "fatal error: back-up on top of a back-up"
test ! -f $at_save_file || mv $at_save_file at-bison-check-$at_save_file.bak
done
}
at_restore_special_files ()
{
for at_save_file in stderr experr expout
do
test ! -f at-bison-check-$at_save_file.bak ||
mv at-bison-check-$at_save_file.bak $at_save_file
done
}
## ------------------------- ##
## Autotest shell functions. ##
## ------------------------- ##
# at_fn_banner NUMBER
# -------------------
# Output banner NUMBER, provided the testsuite is running multiple groups and
# this particular banner has not yet been printed.
at_fn_banner ()
{
$at_print_banners || return 0
eval at_banner_text=\$at_banner_text_$1
test "x$at_banner_text" = "x " && return 0
eval "at_banner_text_$1=\" \""
if test -z "$at_banner_text"; then
$at_first || echo
else
printf "%s\n" "$as_nl$at_banner_text$as_nl"
fi
} # at_fn_banner
# at_fn_check_prepare_notrace REASON LINE
# ---------------------------------------
# Perform AT_CHECK preparations for the command at LINE for an untraceable
# command; REASON is the reason for disabling tracing.
at_fn_check_prepare_notrace ()
{
$at_trace_echo "Not enabling shell tracing (command contains $1)"
printf "%s\n" "$2" >"$at_check_line_file"
at_check_trace=: at_check_filter=:
: >"$at_stdout"; : >"$at_stderr"
}
# at_fn_check_prepare_trace LINE
# ------------------------------
# Perform AT_CHECK preparations for the command at LINE for a traceable
# command.
at_fn_check_prepare_trace ()
{
printf "%s\n" "$1" >"$at_check_line_file"
at_check_trace=$at_traceon at_check_filter=$at_check_filter_trace
: >"$at_stdout"; : >"$at_stderr"
}
# at_fn_check_prepare_dynamic COMMAND LINE
# ----------------------------------------
# Decide if COMMAND at LINE is traceable at runtime, and call the appropriate
# preparation function.
at_fn_check_prepare_dynamic ()
{
case $1 in
*$as_nl*)
at_fn_check_prepare_notrace 'an embedded newline' "$2" ;;
*)
at_fn_check_prepare_trace "$2" ;;
esac
}
# at_fn_filter_trace
# ------------------
# Remove the lines in the file "$at_stderr" generated by "set -x" and print
# them to stderr.
at_fn_filter_trace ()
{
mv "$at_stderr" "$at_stder1"
grep '^ *+' "$at_stder1" >&2
grep -v '^ *+' "$at_stder1" >"$at_stderr"
}
# at_fn_log_failure FILE-LIST
# ---------------------------
# Copy the files in the list on stdout with a "> " prefix, and exit the shell
# with a failure exit code.
at_fn_log_failure ()
{
for file
do printf "%s\n" "$file:"; sed 's/^/> /' "$file"; done
echo 1 > "$at_status_file"
exit 1
}
# at_fn_check_skip EXIT-CODE LINE
# -------------------------------
# Check whether EXIT-CODE is a special exit code (77 or 99), and if so exit
# the test group subshell with that same exit code. Use LINE in any report
# about test failure.
at_fn_check_skip ()
{
case $1 in
99) echo 99 > "$at_status_file"; at_failed=:
printf "%s\n" "$2: hard failure"; exit 99;;
77) echo 77 > "$at_status_file"; exit 77;;
esac
}
# at_fn_check_status EXPECTED EXIT-CODE LINE
# ------------------------------------------
# Check whether EXIT-CODE is the EXPECTED exit code, and if so do nothing.
# Otherwise, if it is 77 or 99, exit the test group subshell with that same
# exit code; if it is anything else print an error message referring to LINE,
# and fail the test.
at_fn_check_status ()
{
case $2 in
$1 ) ;;
77) echo 77 > "$at_status_file"; exit 77;;
99) echo 99 > "$at_status_file"; at_failed=:
printf "%s\n" "$3: hard failure"; exit 99;;
*) printf "%s\n" "$3: exit code was $2, expected $1"
at_failed=:;;
esac
}
# at_fn_diff_devnull FILE
# -----------------------
# Emit a diff between /dev/null and FILE. Uses "test -s" to avoid useless diff
# invocations.
at_fn_diff_devnull ()
{
test -s "$1" || return 0
$at_diff "$at_devnull" "$1"
}
# at_fn_test NUMBER
# -----------------
# Parse out test NUMBER from the tail of this file.
at_fn_test ()
{
eval at_sed=\$at_sed$1
sed "$at_sed" "$at_myself" > "$at_test_source"
}
# at_fn_create_debugging_script
# -----------------------------
# Create the debugging script $at_group_dir/run which will reproduce the
# current test group.
at_fn_create_debugging_script ()
{
{
echo "#! /bin/sh" &&
echo 'test ${ZSH_VERSION+y} && alias -g '\''${1+"$@"}'\''='\''"$@"'\''' &&
printf "%s\n" "cd '$at_dir'" &&
printf "%s\n" "exec \${CONFIG_SHELL-$SHELL} \"$at_myself\" -v -d $at_debug_args $at_group \${1+\"\$@\"}" &&
echo 'exit 1'
} >"$at_group_dir/run" &&
chmod +x "$at_group_dir/run"
}
## -------------------------------- ##
## End of autotest shell functions. ##
## -------------------------------- ##
{
printf "%s\n" "## ---------------- ##
## Tested programs. ##
## ---------------- ##"
echo
} >&5
# Report what programs are being tested.
for at_program in : `eval echo $at_tested`
do
case $at_program in #(
:) :
continue ;; #(
[\\/]* | ?:[\\/]*) :
at_program_=$at_program ;; #(
*) :
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $PATH
do
IFS=$as_save_IFS
case $as_dir in #(((
'') as_dir=./ ;;
*/) ;;
*) as_dir=$as_dir/ ;;
esac
test -f "$as_dir$at_program" && break
done
IFS=$as_save_IFS
at_program_=$as_dir$at_program ;;
esac
if test -f "$at_program_"; then
{
printf "%s\n" "$at_srcdir/local.at:1795: $at_program_ --version"
"$at_program_" --version </dev/null
echo
} >&5 2>&1
else
as_fn_error $? "cannot find $at_program" "$LINENO" 5
fi
done
{
printf "%s\n" "## ------------------ ##
## Running the tests. ##
## ------------------ ##"
} >&5
at_start_date=`date`
at_start_time=`date +%s 2>/dev/null`
printf "%s\n" "$as_me: starting at: $at_start_date" >&5
# Create the master directory if it doesn't already exist.
as_dir="$at_suite_dir"; as_fn_mkdir_p ||
as_fn_error $? "cannot create \`$at_suite_dir'" "$LINENO" 5
# Can we diff with `/dev/null'? DU 5.0 refuses.
if diff /dev/null /dev/null >/dev/null 2>&1; then
at_devnull=/dev/null
else
at_devnull=$at_suite_dir/devnull
>"$at_devnull"
fi
# Use `diff -u' when possible.
if at_diff=`diff -u "$at_devnull" "$at_devnull" 2>&1` && test -z "$at_diff"
then
at_diff='diff -u'
else
at_diff=diff
fi
# Get the last needed group.
for at_group in : $at_groups; do :; done
# Extract the start and end lines of each test group at the tail
# of this file
awk '
BEGIN { FS="" }
/^#AT_START_/ {
start = NR
}
/^#AT_STOP_/ {
test = substr ($ 0, 10)
print "at_sed" test "=\"1," start "d;" (NR-1) "q\""
if (test == "'"$at_group"'") exit
}' "$at_myself" > "$at_suite_dir/at-source-lines" &&
. "$at_suite_dir/at-source-lines" ||
as_fn_error $? "cannot create test line number cache" "$LINENO" 5
rm -f "$at_suite_dir/at-source-lines"
# Set number of jobs for `-j'; avoid more jobs than test groups.
set X $at_groups; shift; at_max_jobs=$#
if test $at_max_jobs -eq 0; then
at_jobs=1
fi
if test $at_jobs -ne 1 &&
{ test $at_jobs -eq 0 || test $at_jobs -gt $at_max_jobs; }; then
at_jobs=$at_max_jobs
fi
# If parallel mode, don't output banners, don't split summary lines.
if test $at_jobs -ne 1; then
at_print_banners=false
at_quiet=:
fi
# Set up helper dirs.
rm -rf "$at_helper_dir" &&
mkdir "$at_helper_dir" &&
cd "$at_helper_dir" &&
{ test -z "$at_groups" || mkdir $at_groups; } ||
as_fn_error $? "testsuite directory setup failed" "$LINENO" 5
# Functions for running a test group. We leave the actual
# test group execution outside of a shell function in order
# to avoid hitting zsh 4.x exit status bugs.
# at_fn_group_prepare
# -------------------
# Prepare for running a test group.
at_fn_group_prepare ()
{
# The directory for additional per-group helper files.
at_job_dir=$at_helper_dir/$at_group
# The file containing the location of the last AT_CHECK.
at_check_line_file=$at_job_dir/check-line
# The file containing the exit status of the last command.
at_status_file=$at_job_dir/status
# The files containing the output of the tested commands.
at_stdout=$at_job_dir/stdout
at_stder1=$at_job_dir/stder1
at_stderr=$at_job_dir/stderr
# The file containing the code for a test group.
at_test_source=$at_job_dir/test-source
# The file containing dates.
at_times_file=$at_job_dir/times
# Be sure to come back to the top test directory.
cd "$at_suite_dir"
# Clearly separate the test groups when verbose.
$at_first || $at_verbose echo
at_group_normalized=$at_group
eval 'while :; do
case $at_group_normalized in #(
'"$at_format"'*) break;;
esac
at_group_normalized=0$at_group_normalized
done'
# Create a fresh directory for the next test group, and enter.
# If one already exists, the user may have invoked ./run from
# within that directory; we remove the contents, but not the
# directory itself, so that we aren't pulling the rug out from
# under the shell's notion of the current directory.
at_group_dir=$at_suite_dir/$at_group_normalized
at_group_log=$at_group_dir/$as_me.log
if test -d "$at_group_dir"
then
find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx {} \;
rm -fr "$at_group_dir"/* "$at_group_dir"/.[!.] "$at_group_dir"/.??*
fi ||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: test directory for $at_group_normalized could not be cleaned" >&5
printf "%s\n" "$as_me: WARNING: test directory for $at_group_normalized could not be cleaned" >&2;}
# Be tolerant if the above `rm' was not able to remove the directory.
as_dir="$at_group_dir"; as_fn_mkdir_p
echo 0 > "$at_status_file"
# In verbose mode, append to the log file *and* show on
# the standard output; in quiet mode only write to the log.
if test -z "$at_verbose"; then
at_tee_pipe='tee -a "$at_group_log"'
else
at_tee_pipe='cat >> "$at_group_log"'
fi
}
# at_fn_group_banner ORDINAL LINE DESC PAD [BANNER]
# -------------------------------------------------
# Declare the test group ORDINAL, located at LINE with group description DESC,
# and residing under BANNER. Use PAD to align the status column.
at_fn_group_banner ()
{
at_setup_line="$2"
test -n "$5" && at_fn_banner $5
at_desc="$3"
case $1 in
[0-9]) at_desc_line=" $1: ";;
[0-9][0-9]) at_desc_line=" $1: " ;;
*) at_desc_line="$1: " ;;
esac
as_fn_append at_desc_line "$3$4"
$at_quiet printf %s "$at_desc_line"
echo "# -*- compilation -*-" >> "$at_group_log"
}
# at_fn_group_postprocess
# -----------------------
# Perform cleanup after running a test group.
at_fn_group_postprocess ()
{
# Be sure to come back to the suite directory, in particular
# since below we might `rm' the group directory we are in currently.
cd "$at_suite_dir"
if test ! -f "$at_check_line_file"; then
sed "s/^ */$as_me: WARNING: /" <<_ATEOF
A failure happened in a test group before any test could be
run. This means that test suite is improperly designed. Please
report this failure to <bug-bison@gnu.org>.
_ATEOF
printf "%s\n" "$at_setup_line" >"$at_check_line_file"
at_status=99
fi
$at_verbose printf %s "$at_group. $at_setup_line: "
printf %s "$at_group. $at_setup_line: " >> "$at_group_log"
case $at_xfail:$at_status in
yes:0)
at_msg="UNEXPECTED PASS"
at_res=xpass
at_errexit=$at_errexit_p
at_color=$at_red
;;
no:0)
at_msg="ok"
at_res=pass
at_errexit=false
at_color=$at_grn
;;
*:77)
at_msg='skipped ('`cat "$at_check_line_file"`')'
at_res=skip
at_errexit=false
at_color=$at_blu
;;
no:* | *:99)
at_msg='FAILED ('`cat "$at_check_line_file"`')'
at_res=fail
at_errexit=$at_errexit_p
at_color=$at_red
;;
yes:*)
at_msg='expected failure ('`cat "$at_check_line_file"`')'
at_res=xfail
at_errexit=false
at_color=$at_lgn
;;
esac
echo "$at_res" > "$at_job_dir/$at_res"
# In parallel mode, output the summary line only afterwards.
if test $at_jobs -ne 1 && test -n "$at_verbose"; then
printf "%s\n" "$at_desc_line $at_color$at_msg$at_std"
else
# Make sure there is a separator even with long titles.
printf "%s\n" " $at_color$at_msg$at_std"
fi
at_log_msg="$at_group. $at_desc ($at_setup_line): $at_msg"
case $at_status in
0|77)
# $at_times_file is only available if the group succeeded.
# We're not including the group log, so the success message
# is written in the global log separately. But we also
# write to the group log in case they're using -d.
if test -f "$at_times_file"; then
at_log_msg="$at_log_msg ("`sed 1d "$at_times_file"`')'
rm -f "$at_times_file"
fi
printf "%s\n" "$at_log_msg" >> "$at_group_log"
printf "%s\n" "$at_log_msg" >&5
# Cleanup the group directory, unless the user wants the files
# or the success was unexpected.
if $at_debug_p || test $at_res = xpass; then
at_fn_create_debugging_script
if test $at_res = xpass && $at_errexit; then
echo stop > "$at_stop_file"
fi
else
if test -d "$at_group_dir"; then
find "$at_group_dir" -type d ! -perm -700 -exec chmod u+rwx \{\} \;
rm -fr "$at_group_dir"
fi
rm -f "$at_test_source"
fi
;;
*)
# Upon failure, include the log into the testsuite's global
# log. The failure message is written in the group log. It
# is later included in the global log.
printf "%s\n" "$at_log_msg" >> "$at_group_log"
# Upon failure, keep the group directory for autopsy, and create
# the debugging script. With -e, do not start any further tests.
at_fn_create_debugging_script
if $at_errexit; then
echo stop > "$at_stop_file"
fi
;;
esac
}
## ------------ ##
## Driver loop. ##
## ------------ ##
if (set -m && set +m && set +b) >/dev/null 2>&1; then
set +b
at_job_control_on='set -m' at_job_control_off='set +m' at_job_group=-
else
at_job_control_on=: at_job_control_off=: at_job_group=
fi
for at_signal in 1 2 15; do
trap 'set +x; set +e
$at_job_control_off
at_signal='"$at_signal"'
echo stop > "$at_stop_file"
trap "" $at_signal
at_pgids=
for at_pgid in `jobs -p 2>/dev/null`; do
at_pgids="$at_pgids $at_job_group$at_pgid"
done
test -z "$at_pgids" || kill -$at_signal $at_pgids 2>/dev/null
wait
if test "$at_jobs" -eq 1 || test -z "$at_verbose"; then
echo >&2
fi
at_signame=`kill -l $at_signal 2>&1 || echo $at_signal`
set x $at_signame
test 0 -gt 2 && at_signame=$at_signal
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: caught signal $at_signame, bailing out" >&5
printf "%s\n" "$as_me: WARNING: caught signal $at_signame, bailing out" >&2;}
as_fn_arith 128 + $at_signal && exit_status=$as_val
as_fn_exit $exit_status' $at_signal
done
rm -f "$at_stop_file"
at_first=:
if test $at_jobs -ne 1 &&
rm -f "$at_job_fifo" &&
test -n "$at_job_group" &&
( mkfifo "$at_job_fifo" && trap 'exit 1' PIPE STOP TSTP ) 2>/dev/null
then
# FIFO job dispatcher.
trap 'at_pids=
for at_pid in `jobs -p`; do
at_pids="$at_pids $at_job_group$at_pid"
done
if test -n "$at_pids"; then
at_sig=TSTP
test ${TMOUT+y} && at_sig=STOP
kill -$at_sig $at_pids 2>/dev/null
fi
kill -STOP $$
test -z "$at_pids" || kill -CONT $at_pids 2>/dev/null' TSTP
echo
# Turn jobs into a list of numbers, starting from 1.
at_joblist=`printf "%s\n" "$at_groups" | sed -n 1,${at_jobs}p`
set X $at_joblist
shift
for at_group in $at_groups; do
$at_job_control_on 2>/dev/null
(
# Start one test group.
$at_job_control_off
if $at_first; then
exec 7>"$at_job_fifo"
else
exec 6<&-
fi
trap 'set +x; set +e
trap "" PIPE
echo stop > "$at_stop_file"
echo >&7
as_fn_exit 141' PIPE
at_fn_group_prepare
if cd "$at_group_dir" &&
at_fn_test $at_group &&
. "$at_test_source"
then :; else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
at_failed=:
fi
at_fn_group_postprocess
echo >&7
) &
$at_job_control_off
if $at_first; then
at_first=false
exec 6<"$at_job_fifo" 7>"$at_job_fifo"
fi
shift # Consume one token.
if test $# -gt 0; then :; else
read at_token <&6 || break
set x $*
fi
test -f "$at_stop_file" && break
done
exec 7>&-
# Read back the remaining ($at_jobs - 1) tokens.
set X $at_joblist
shift
if test $# -gt 0; then
shift
for at_job
do
read at_token
done <&6
fi
exec 6<&-
wait
else
# Run serially, avoid forks and other potential surprises.
for at_group in $at_groups; do
at_fn_group_prepare
if cd "$at_group_dir" &&
at_fn_test $at_group &&
. "$at_test_source"; then :; else
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unable to parse test group: $at_group" >&5
printf "%s\n" "$as_me: WARNING: unable to parse test group: $at_group" >&2;}
at_failed=:
fi
at_fn_group_postprocess
test -f "$at_stop_file" && break
at_first=false
done
fi
# Wrap up the test suite with summary statistics.
cd "$at_helper_dir"
# Use ?..???? when the list must remain sorted, the faster * otherwise.
at_pass_list=`for f in */pass; do echo $f; done | sed '/\*/d; s,/pass,,'`
at_skip_list=`for f in */skip; do echo $f; done | sed '/\*/d; s,/skip,,'`
at_xfail_list=`for f in */xfail; do echo $f; done | sed '/\*/d; s,/xfail,,'`
at_xpass_list=`for f in ?/xpass ??/xpass ???/xpass ????/xpass; do
echo $f; done | sed '/?/d; s,/xpass,,'`
at_fail_list=`for f in ?/fail ??/fail ???/fail ????/fail; do
echo $f; done | sed '/?/d; s,/fail,,'`
set X $at_pass_list $at_xpass_list $at_xfail_list $at_fail_list $at_skip_list
shift; at_group_count=$#
set X $at_xpass_list; shift; at_xpass_count=$#; at_xpass_list=$*
set X $at_xfail_list; shift; at_xfail_count=$#
set X $at_fail_list; shift; at_fail_count=$#; at_fail_list=$*
set X $at_skip_list; shift; at_skip_count=$#
as_fn_arith $at_group_count - $at_skip_count && at_run_count=$as_val
as_fn_arith $at_xpass_count + $at_fail_count && at_unexpected_count=$as_val
as_fn_arith $at_xfail_count + $at_fail_count && at_total_fail_count=$as_val
# Back to the top directory.
cd "$at_dir"
rm -rf "$at_helper_dir"
# Compute the duration of the suite.
at_stop_date=`date`
at_stop_time=`date +%s 2>/dev/null`
printf "%s\n" "$as_me: ending at: $at_stop_date" >&5
case $at_start_time,$at_stop_time in
[0-9]*,[0-9]*)
as_fn_arith $at_stop_time - $at_start_time && at_duration_s=$as_val
as_fn_arith $at_duration_s / 60 && at_duration_m=$as_val
as_fn_arith $at_duration_m / 60 && at_duration_h=$as_val
as_fn_arith $at_duration_s % 60 && at_duration_s=$as_val
as_fn_arith $at_duration_m % 60 && at_duration_m=$as_val
at_duration="${at_duration_h}h ${at_duration_m}m ${at_duration_s}s"
printf "%s\n" "$as_me: test suite duration: $at_duration" >&5
;;
esac
echo
printf "%s\n" "## ------------- ##
## Test results. ##
## ------------- ##"
echo
{
echo
printf "%s\n" "## ------------- ##
## Test results. ##
## ------------- ##"
echo
} >&5
if test $at_run_count = 1; then
at_result="1 test"
at_were=was
else
at_result="$at_run_count tests"
at_were=were
fi
if $at_errexit_p && test $at_unexpected_count != 0; then
if test $at_xpass_count = 1; then
at_result="$at_result $at_were run, one passed"
else
at_result="$at_result $at_were run, one failed"
fi
at_result="$at_result unexpectedly and inhibited subsequent tests."
at_color=$at_red
else
# Don't you just love exponential explosion of the number of cases?
at_color=$at_red
case $at_xpass_count:$at_fail_count:$at_xfail_count in
# So far, so good.
0:0:0) at_result="$at_result $at_were successful." at_color=$at_grn ;;
0:0:*) at_result="$at_result behaved as expected." at_color=$at_lgn ;;
# Some unexpected failures
0:*:0) at_result="$at_result $at_were run,
$at_fail_count failed unexpectedly." ;;
# Some failures, both expected and unexpected
0:*:1) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
0:*:*) at_result="$at_result $at_were run,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
# No unexpected failures, but some xpasses
*:0:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly." ;;
# No expected failures, but failures and xpasses
*:1:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failure)." ;;
*:*:0) at_result="$at_result $at_were run,
$at_unexpected_count did not behave as expected ($at_fail_count unexpected failures)." ;;
# All of them.
*:*:1) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failure)." ;;
*:*:*) at_result="$at_result $at_were run,
$at_xpass_count passed unexpectedly,
$at_total_fail_count failed ($at_xfail_count expected failures)." ;;
esac
if test $at_skip_count = 0 && test $at_run_count -gt 1; then
at_result="All $at_result"
fi
fi
# Now put skips in the mix.
case $at_skip_count in
0) ;;
1) at_result="$at_result
1 test was skipped." ;;
*) at_result="$at_result
$at_skip_count tests were skipped." ;;
esac
if test $at_unexpected_count = 0; then
echo "$at_color$at_result$at_std"
echo "$at_result" >&5
else
echo "${at_color}ERROR: $at_result$at_std" >&2
echo "ERROR: $at_result" >&5
{
echo
printf "%s\n" "## ------------------------ ##
## Summary of the failures. ##
## ------------------------ ##"
# Summary of failed and skipped tests.
if test $at_fail_count != 0; then
echo "Failed tests:"
$SHELL "$at_myself" $at_fail_list --list
echo
fi
if test $at_skip_count != 0; then
echo "Skipped tests:"
$SHELL "$at_myself" $at_skip_list --list
echo
fi
if test $at_xpass_count != 0; then
echo "Unexpected passes:"
$SHELL "$at_myself" $at_xpass_list --list
echo
fi
if test $at_fail_count != 0; then
printf "%s\n" "## ---------------------- ##
## Detailed failed tests. ##
## ---------------------- ##"
echo
for at_group in $at_fail_list
do
at_group_normalized=$at_group
eval 'while :; do
case $at_group_normalized in #(
'"$at_format"'*) break;;
esac
at_group_normalized=0$at_group_normalized
done'
cat "$at_suite_dir/$at_group_normalized/$as_me.log"
echo
done
echo
fi
if test -n "$at_top_srcdir"; then
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## ${at_top_build_prefix}config.log ##
_ASBOX
sed 's/^/| /' ${at_top_build_prefix}config.log
echo
fi
} >&5
sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
## $as_me.log was created. ##
_ASBOX
echo
if $at_debug_p; then
at_msg='per-test log files'
else
at_msg="\`${at_testdir+${at_testdir}/}$as_me.log'"
fi
at_msg1a=${at_xpass_list:+', '}
at_msg1=$at_fail_list${at_fail_list:+" failed$at_msg1a"}
at_msg2=$at_xpass_list${at_xpass_list:+" passed unexpectedly"}
printf "%s\n" "Please send $at_msg and all information you think might help:
To: <bug-bison@gnu.org>
Subject: [GNU Bison 3.8.2] $as_me: $at_msg1$at_msg2
You may investigate any problem if you feel able to do so, in which
case the test suite provides a good starting point. Its output may
be found below \`${at_testdir+${at_testdir}/}$as_me.dir'.
"
exit 1
fi
exit 0
## ------------- ##
## Actual tests. ##
## ------------- ##
#AT_START_1
at_fn_group_banner 1 'm4.at:21' \
"Generating Comments" " " 1
at_xfail=no
(
printf "%s\n" "1. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp:
_ATEOF
cat >input.m4 <<'_ATEOF'
m4_include(b4_skeletonsdir/[c.m4])
b4_output_begin([output.txt])
b4_gsub([[abcd]],
[a], [b])
b4_gsub([[abcd]],
[a], [b],
[b], [c],
[c], [d])
_b4_comment([["/* () */"]])
_b4_comment([["/* ( */"]])
_b4_comment([["/* ) */"]])
_b4_comment([["/* [] */"]])
b4_comment([["/* () */"]])
b4_comment([["/* ( */"]])
b4_comment([["/* ) */"]])
b4_comment([["/* [] */"]])
b4_output_end([output.txt])
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -S ./input.m4 input.y"
at_fn_check_prepare_notrace 'an embedded newline' "m4.at:53"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -S ./input.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S ./input.m4 input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S ./input.m4 input.y" "m4.at:53"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -S ./input.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "m4.at:53"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "m4.at:53"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "m4.at:53"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/m4.at:53: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -S ./input.m4 input.y"
at_fn_check_prepare_trace "m4.at:53"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -S ./input.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/m4.at:55: cat output.txt"
at_fn_check_prepare_trace "m4.at:55"
( $at_check_trace; cat output.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
[bbcd]
[dddd]
\"/\\* () *\\/\"
\"/\\* ( *\\/\"
\"/\\* ) *\\/\"
\"/\\* [] *\\/\"
/* \"/\\* () *\\/\" */
/* \"/\\* ( *\\/\" */
/* \"/\\* ) *\\/\" */
/* \"/\\* [] *\\/\" */
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/m4.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_1
#AT_START_2
at_fn_group_banner 2 'input.at:27' \
"Invalid number of arguments" " " 2
at_xfail=no
(
printf "%s\n" "2. $at_setup_line: testing $at_desc ..."
$at_traceon
{ set +x
printf "%s\n" "$at_srcdir/input.at:29: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret "
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret " "input.at:29"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "bison: missing operand
Try 'bison --help' for more information.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:29"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:34: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y" "input.at:34"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "bison: extra operand '2.y'
Try 'bison --help' for more information.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:34"
$at_failed && at_fn_log_failure
$at_traceon; }
# For some reason, on some systems we use the system's getopt, not the
# one we ship in gnulib. So we can get two different error messages.
# See https://lists.gnu.org/r/bison-patches/2018-10/msg00154.html
{ set +x
printf "%s\n" "$at_srcdir/input.at:42: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton" "input.at:42"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --skeleton
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:43: sed -e \\
\"s/requires an argument -- skeleton/'--skeleton' requires an argument/\" \\
stderr"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:43"
( $at_check_trace; sed -e \
"s/requires an argument -- skeleton/'--skeleton' requires an argument/" \
stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "bison: option '--skeleton' requires an argument
Try 'bison --help' for more information.
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_2
#AT_START_3
at_fn_group_banner 3 'input.at:58' \
"Invalid options" " " 2
at_xfail=no
(
printf "%s\n" "3. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: '0'
_ATEOF
# We used to accept these, as -f, --report and others were sharing
# their code with -W.
{ set +x
printf "%s\n" "$at_srcdir/input.at:67: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y" "input.at:67"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -ferror=caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:67"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y" "input.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=error=itemsets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
# We used to accept any character after "-Werror", instead of ensuring
# this is "=".
{ set +x
printf "%s\n" "$at_srcdir/input.at:72: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y" "input.at:72"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror?all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:72"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_3
#AT_START_4
at_fn_group_banner 4 'input.at:83' \
"Invalid inputs" " " 2
at_xfail=no
(
printf "%s\n" "4. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%header "\360\000\200\210"
\000\001\002\377?
"\000"
%%
?
default: 'a' }
%&
%a-does-not-exist
%-
%{
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:97: \"\$PERL\" -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' input.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' input.y || exit 77" "input.at:97"
( $at_check_trace; "$PERL" -pi -e 's/\\(\d{3})/chr(oct($1))/ge' input.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:99: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:99"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:99"
$at_failed && at_fn_log_failure
$at_traceon; }
# Autotest's diffing, when there are NUL bytes, just reports "binary
# files differ". So don't leave NUL bytes. And don't leave invalid
# mbchars either: escape raw binary.
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/input.at:104: \"\$PERL\" -p -e 's{([\\0\\200\\210\\360\\377])}{sprintf \"\\\\x%02x\", ord(\$1)}ge' stderr"
at_fn_check_prepare_dynamic "\"$PERL\" -p -e 's{([\\0\\200\\210\\360\\377])}{sprintf \"\\\\x%02x\", ord($1)}ge' stderr" "input.at:104"
( $at_check_trace; "$PERL" -p -e 's{([\0\200\210\360\377])}{sprintf "\\x%02x", ord($1)}ge' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:1.11: error: invalid null character
1 | %header \"\\xf0\\x00\\x80\\x88\"
| ^
input.y:2.1-2: error: invalid characters: '\\0\\001\\002\\377?'
2 | \\x00\\xff?
| ^~
input.y:3.2: error: invalid null character
3 | \"\\x00\"
| ^
input.y:5.1: error: invalid character: '?'
5 | ?
| ^
input.y:6.14: error: invalid character: '}'
6 | default: 'a' }
| ^
input.y:7.1: error: invalid character: '%'
7 | %&
| ^
input.y:7.2: error: invalid character: '&'
7 | %&
| ^
input.y:8.1-17: error: invalid directive: '%a-does-not-exist'
8 | %a-does-not-exist
| ^~~~~~~~~~~~~~~~~
input.y:9.1: error: invalid character: '%'
9 | %-
| ^
input.y:9.2: error: invalid character: '-'
9 | %-
| ^
input.y:10.1-11.0: error: missing '%}' at end of file
10 | %{
| ^~
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_4
#AT_START_5
at_fn_group_banner 5 'input.at:147' \
"Invalid inputs with {}" " " 2
at_xfail=no
(
printf "%s\n" "5. $at_setup_line: testing $at_desc ..."
$at_traceon
# We used to SEGV here. See
# https://lists.gnu.org/r/bug-bison/2005-07/msg00053.html
cat >input.y <<'_ATEOF'
%destructor
%initial-action
%lex-param
%parse-param
%printer
%union
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:162: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:162"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-15: error: expected {...} before %initial-action
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:162"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_5
#AT_START_6
at_fn_group_banner 6 'input.at:173' \
"Yacc warnings on symbols" " " 2
at_xfail=no
(
printf "%s\n" "6. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%nterm exp
%token NUM 0x40 "number"
%%
exp: "number";
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wyacc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:182"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:182"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:182"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y"
at_fn_check_prepare_trace "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
1 | %nterm exp
| ^~~~~~
input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc]
2 | %token NUM 0x40 \"number\"
| ^~~~
input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc]
2 | %token NUM 0x40 \"number\"
| ^~~~~~~~
input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc]
4 | exp: \"number\";
| ^~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
1 | %nterm exp
| ^~~~~~
input.y:2.12-15: warning: POSIX Yacc does not support hexadecimal literals [-Wyacc]
2 | %token NUM 0x40 "number"
| ^~~~
input.y:2.17-24: warning: POSIX Yacc does not support string literals [-Wyacc]
2 | %token NUM 0x40 "number"
| ^~~~~~~~
input.y:4.6-13: warning: POSIX Yacc does not support string literals [-Wyacc]
4 | exp: "number";
| ^~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:182"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_6
#AT_START_7
at_fn_group_banner 7 'input.at:204' \
"Yacc warnings" " " 2
at_xfail=no
(
printf "%s\n" "7. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%destructor {} <int>
%printer {} <int>
%type <int> exp a b
%%
exp: a b { $$ = $1 + $2; };
a: <int>{ $$ = 42; } { $$ = $1; };
b: %empty { $$ = 42; };
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wyacc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:216"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:216"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:216"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y"
at_fn_check_prepare_trace "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc]
1 | %destructor {} <int>
| ^~~~~~~~~~~
input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc]
2 | %printer {} <int>
| ^~~~~~~~
input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc]
6 | a: <int>{ \$\$ = 42; } { \$\$ = \$1; };
| ^~~~~~~~~~~~
input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc]
7 | b: %empty { \$\$ = 42; };
| ^~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.1-11: warning: POSIX Yacc does not support %destructor [-Wyacc]
1 | %destructor {} <int>
| ^~~~~~~~~~~
input.y:2.1-8: warning: POSIX Yacc does not support %printer [-Wyacc]
2 | %printer {} <int>
| ^~~~~~~~
input.y:6.9-20: warning: POSIX Yacc does not support typed midrule actions [-Wyacc]
6 | a: <int>{ $$ = 42; } { $$ = $1; };
| ^~~~~~~~~~~~
input.y:7.4-9: warning: POSIX Yacc does not support %empty [-Wyacc]
7 | b: %empty { $$ = 42; };
| ^~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:216"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:216: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:216"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:216"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_7
#AT_START_8
at_fn_group_banner 8 'input.at:238' \
"Yacc's %type" " " 2
at_xfail=no
(
printf "%s\n" "8. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token TOKEN1
%nterm nterm1
%type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
%token TOKEN2
%nterm nterm2
%%
expr: nterm1 nterm2 nterm3
nterm1: TOKEN1
nterm2: TOKEN2
nterm3: "TOKEN3"
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wyacc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y" "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:253"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:253"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:253"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y"
at_fn_check_prepare_trace "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wyacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
2 | %nterm nterm1
| ^~~~~~
input.y:3.14-19: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+'
| ^~~~~~
input.y:3.28-35: warning: POSIX Yacc does not support string literals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+'
| ^~~~~~~~
input.y:3.28-35: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+'
| ^~~~~~~~
input.y:3.58-60: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+'
| ^~~
input.y:5.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
5 | %nterm nterm2
| ^~~~~~
input.y:3.21-26: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 \"TOKEN3\" nterm1 nterm2 nterm3 '+'
| ^~~~~~
input.y:10.9-16: warning: POSIX Yacc does not support string literals [-Wyacc]
10 | nterm3: \"TOKEN3\"
| ^~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror" "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
2 | %nterm nterm1
| ^~~~~~
input.y:3.14-19: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
| ^~~~~~
input.y:3.28-35: warning: POSIX Yacc does not support string literals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
| ^~~~~~~~
input.y:3.28-35: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
| ^~~~~~~~
input.y:3.58-60: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
| ^~~
input.y:5.1-6: warning: POSIX Yacc does not support %nterm [-Wyacc]
5 | %nterm nterm2
| ^~~~~~
input.y:3.21-26: warning: POSIX yacc reserves %type to nonterminals [-Wyacc]
3 | %type <ival> TOKEN1 TOKEN2 "TOKEN3" nterm1 nterm2 nterm3 '+'
| ^~~~~~
input.y:10.9-16: warning: POSIX Yacc does not support string literals [-Wyacc]
10 | nterm3: "TOKEN3"
| ^~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:253"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error" "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none" "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none" "input.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wyacc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_8
#AT_START_9
at_fn_group_banner 9 'input.at:287' \
"Invalid symbol declarations" " " 2
at_xfail=no
(
printf "%s\n" "9. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%nterm expr "expression";
%nterm term 123;
%nterm fact 124 "factor";
%nterm '+' '*';
%nterm "number";
%token "tok1" 1;
%left "tok2" 2;
%type "tok3" 3;
%%
expr: expr '+' term | term;
term: term '*' fact | fact;
fact: "number";
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:304: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:304"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.13-24: error: nonterminals cannot be given a string alias
1 | %nterm expr \"expression\";
| ^~~~~~~~~~~~
input.y:2.13-15: error: nonterminals cannot be given a token code
2 | %nterm term 123;
| ^~~
input.y:3.13-15: error: nonterminals cannot be given a token code
3 | %nterm fact 124 \"factor\";
| ^~~
input.y:3.17-24: error: nonterminals cannot be given a string alias
3 | %nterm fact 124 \"factor\";
| ^~~~~~~~
input.y:4.8-10: error: character literals cannot be nonterminals
4 | %nterm '+' '*';
| ^~~
input.y:5.8-15: error: expected character literal or identifier or <tag> before string
5 | %nterm \"number\";
| ^~~~~~~~
input.y:6.8-13: error: expected character literal or identifier or <tag> before string
6 | %token \"tok1\" 1;
| ^~~~~~
input.y:7.14: error: unexpected integer literal
7 | %left \"tok2\" 2;
| ^
input.y:8.14: error: unexpected integer literal
8 | %type \"tok3\" 3;
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:304"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_9
#AT_START_10
at_fn_group_banner 10 'input.at:341' \
"Redefining the error token" " " 2
at_xfail=no
(
printf "%s\n" "10. $at_setup_line: testing $at_desc ..."
$at_traceon
# We used to crash when trying to display the original definition of
# "error", which is a builtin without any location.
cat >input.y <<'_ATEOF'
%token error 123
%token error 124
%%
exp:
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-12: warning: symbol error redeclared [-Wother]
2 | %token error 124
| ^~~~~
input.y:1.8-12: note: previous declaration
1 | %token error 123
| ^~~~~
input.y:2.14-16: error: redefining code of token error
2 | %token error 124
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:354"
$at_failed && at_fn_log_failure
$at_traceon; }
# While at it, make sure we properly used the user's number for
# "error". I don't see what it buys us, but...
cat >input.y <<'_ATEOF'
%{
#include <assert.h>
#include <stdio.h>
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
%}
%token error 123
%%
exp:
%%
int main (void)
{
assert (YYerror == 123);
assert (YYTRANSLATE (YYEOF) == YYSYMBOL_YYEOF);
assert (YYTRANSLATE (YYerror) == YYSYMBOL_YYerror);
assert (YYTRANSLATE (YYUNDEF) == YYSYMBOL_YYUNDEF);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:390"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:390"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:390"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "input.at:390" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:390"
{ set +x
printf "%s\n" "$at_srcdir/input.at:390: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "input.at:390"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:391: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:391"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "input.at:391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:391"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_10
#AT_START_11
at_fn_group_banner 11 'input.at:401' \
"Dangling aliases" " " 2
at_xfail=no
(
printf "%s\n" "11. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token FOO "foo"
%type <val> "bar"
%%
expr: "foo" "bar" "baz"
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wdangling input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wdangling input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y" "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wdangling input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:410"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:410"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:410"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wdangling input.y"
at_fn_check_prepare_trace "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wdangling input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.13-17: warning: string literal \"bar\" not attached to a symbol [-Wdangling-alias]
2 | %type <val> \"bar\"
| ^~~~~
input.y:4.19-23: warning: string literal \"baz\" not attached to a symbol [-Wdangling-alias]
4 | expr: \"foo\" \"bar\" \"baz\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Werror" "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.13-17: warning: string literal "bar" not attached to a symbol [-Wdangling-alias]
2 | %type <val> "bar"
| ^~~~~
input.y:4.19-23: warning: string literal "baz" not attached to a symbol [-Wdangling-alias]
4 | expr: "foo" "bar" "baz"
| ^~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:410"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=error" "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none" "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:410: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none" "input.at:410"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wdangling input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:410"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_11
#AT_START_12
at_fn_group_banner 12 'input.at:427' \
"Symbol declarations" " " 2
at_xfail=no
(
printf "%s\n" "12. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >dump-symbols.m4 <<'_ATEOF'
m4_define([b4_api_PREFIX], [YY])
m4_define([b4_symbol_dump],
[$1, dnl
b4_symbol_if([$1], [is_token], [Token], [Nonterminal]), dnl
b4_symbol([$1], [tag]), dnl
b4_symbol([$1], [id]), dnl
b4_symbol([$1], [code]), dnl
b4_symbol([$1], [type]),
])
b4_output_begin([symbols.csv])
number, class, tag, id, code, type,
b4_symbol_foreach([b4_symbol_dump])dnl
b4_output_end
_ATEOF
cat >input.y <<'_ATEOF'
%token 'a' A1 1 "A1" A2 A3 "A3" A4 4
<type_b> 'b' B5 5 "B5" B6 B7 "B8" B9 9
<type_c> 'c' C10 10 "C10" C11 C12 "C12" C13 13
%left 'd' D20 20 "D20" D21 D22 "D22" D23 23
<type_e> 'e' E25 25 "E25" E26 E27 "E28" E29 29
<type_f> 'f' F30 30 "F30" F31 F32 "F32" F33 33
%type 'g' G40 "D40" G21 G22 G23
<type_h> 'h' H25 "H25" H26 H27 "H28" H29
<type_i> 'i' I30 "I30" I31 I32 "I32" I33
%nterm j60 j61 j62 j63
<type_k> k75 k76 k77 k79
<type_l> l80 l81 l82 l83
%%
exp:;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S./dump-symbols.m4 input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:467"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S./dump-symbols.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y" "input.at:467"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S./dump-symbols.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:467"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:467"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:467"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:467: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S./dump-symbols.m4 input.y"
at_fn_check_prepare_trace "input.at:467"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S./dump-symbols.m4 input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:468: cat symbols.csv"
at_fn_check_prepare_trace "input.at:468"
( $at_check_trace; cat symbols.csv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "number, class, tag, id, code, type,
0, Token, \"end of file\", YYEOF, 0, ,
1, Token, error, YYerror, 256, ,
2, Token, \"invalid token\", YYUNDEF, 257, ,
3, Token, 'a', , 97, ,
4, Token, \"A1\", A1, 1, ,
5, Token, A2, A2, 258, ,
6, Token, \"A3\", A3, 259, ,
7, Token, A4, A4, 4, ,
8, Token, 'b', , 98, type_b,
9, Token, \"B5\", B5, 5, type_b,
10, Token, B6, B6, 260, type_b,
11, Token, \"B8\", B7, 261, type_b,
12, Token, B9, B9, 9, type_b,
13, Token, 'c', , 99, type_c,
14, Token, \"C10\", C10, 10, type_c,
15, Token, C11, C11, 262, type_c,
16, Token, \"C12\", C12, 263, type_c,
17, Token, C13, C13, 13, type_c,
18, Token, 'd', , 100, ,
19, Token, D20, D20, 20, ,
20, Token, \"D20\", , 264, ,
21, Token, D21, D21, 265, ,
22, Token, D22, D22, 266, ,
23, Token, \"D22\", , 267, ,
24, Token, D23, D23, 23, ,
25, Token, 'e', , 101, type_e,
26, Token, E25, E25, 25, type_e,
27, Token, \"E25\", , 268, type_e,
28, Token, E26, E26, 269, type_e,
29, Token, E27, E27, 270, type_e,
30, Token, \"E28\", , 271, type_e,
31, Token, E29, E29, 29, type_e,
32, Token, 'f', , 102, type_f,
33, Token, F30, F30, 30, type_f,
34, Token, \"F30\", , 272, type_f,
35, Token, F31, F31, 273, type_f,
36, Token, F32, F32, 274, type_f,
37, Token, \"F32\", , 275, type_f,
38, Token, F33, F33, 33, type_f,
39, Token, 'g', , 103, ,
40, Token, \"D40\", , 276, ,
41, Token, 'h', , 104, type_h,
42, Token, \"H25\", , 277, type_h,
43, Token, \"H28\", , 278, type_h,
44, Token, 'i', , 105, type_i,
45, Token, \"I30\", , 279, type_i,
46, Token, \"I32\", , 280, type_i,
47, Nonterminal, \$accept, , -1, ,
48, Nonterminal, exp, exp, -1, ,
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:468"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_12
#AT_START_13
at_fn_group_banner 13 'input.at:528' \
"Invalid \$n and @n" " " 2
at_xfail=no
(
printf "%s\n" "13. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: %empty { $$ = $1 ; };
exp: %empty { @$ = @1 ; };
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:536: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:536"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.20-21: error: integer out of range: '\$1'
2 | exp: %empty { \$\$ = \$1 ; };
| ^~
input.y:3.20-21: error: integer out of range: '@1'
3 | exp: %empty { @\$ = @1 ; };
| ^~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:536"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_13
#AT_START_14
at_fn_group_banner 14 'input.at:552' \
"Type Clashes" " " 2
at_xfail=no
(
printf "%s\n" "14. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%union { int bar; }
%token foo
%type <bar> exp
%%
exp: foo { $$; } foo { $2; } foo
| foo
| %empty
;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:565: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:565"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:5.12-13: error: \$\$ for the midrule at \$2 of 'exp' has no declared type
5 | exp: foo { \$\$; } foo { \$2; } foo
| ^~
input.y:5.24-25: error: \$2 of 'exp' has no declared type
5 | exp: foo { \$\$; } foo { \$2; } foo
| ^~
input.y:5.6-32: warning: type clash on default action: <bar> != <> [-Wother]
5 | exp: foo { \$\$; } foo { \$2; } foo
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.6-8: warning: type clash on default action: <bar> != <> [-Wother]
6 | | foo
| ^~~
input.y:7.6-11: warning: empty rule for typed nonterminal, and no action [-Wother]
7 | | %empty
| ^~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:565"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_14
#AT_START_15
at_fn_group_banner 15 'input.at:774' \
"Unused values" " " 2
at_xfail=no
(
printf "%s\n" "15. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token <integer> INT;
%type <integer> a b c d e f g h i j k l m n o;
%destructor { destroy ($$); } <integer>;
%%
start:
'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
| 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
| 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
| 'm' m { $2; } | 'n' n { $2; } | 'o' o { $2; }
;
a: INT | INT { } INT { } INT { };
b: INT | %empty;
c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
d: INT | INT { } INT { $1; } INT { $<integer>2; };
e: INT | INT { } INT { } INT { $1; };
f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
m: INT | INT <integer>{ $$ = $1; } INT <integer>{ $$ = $2 + $3; } INT { $$ = $4 + $5; };
n: INT | INT <integer>{ } INT <integer>{ } INT { };
o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:775"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:775"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:775"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.10-32: warning: unset value: \$\$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: \$1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: \$3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: \$5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.10-62: warning: unset value: \$\$ [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: \$3 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: \$5 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:15.10-49: warning: unset value: \$\$ [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: \$3 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: \$5 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: \$\$ [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: \$3 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:16.27-29: warning: unused value: \$5 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:18.10-58: warning: unset value: \$\$ [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: \$1 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.31-33: warning: unused value: \$3 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.52-54: warning: unused value: \$5 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: \$\$ [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: \$1 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: \$3 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.66-68: warning: unused value: \$5 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:22.10-68: warning: unset value: \$\$ [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: \$1 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: \$2 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:25.23-25: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: \$1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: \$2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: \$3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: \$4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: \$5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
input.y:26.40-42: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:12.10-32: warning: unset value: $$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: $3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: $5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.10-62: warning: unset value: $$ [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $3 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: $5 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:15.10-49: warning: unset value: $$ [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $3 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: $5 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: $$ [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $3 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:16.27-29: warning: unused value: $5 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:18.10-58: warning: unset value: $$ [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $1 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.31-33: warning: unused value: $3 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.52-54: warning: unused value: $5 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: $$ [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $1 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: $3 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.66-68: warning: unused value: $5 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:22.10-68: warning: unset value: $$ [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $1 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: $2 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:25.23-25: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: $2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: $3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: $4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: $5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
input.y:26.40-42: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:775"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%token <integer> INT;
%type <integer> a b c d e f g h i j k l m n o;
%destructor { destroy ($$); } <integer>;
%%
start:
'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
| 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
| 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
| 'm' m { $2; } | 'n' n { $2; } | 'o' o { $2; }
;
a: INT | INT { } INT { } INT { };
b: INT | %empty;
c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
d: INT | INT { } INT { $1; } INT { $<integer>2; };
e: INT | INT { } INT { } INT { $1; };
f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
m: INT | INT <integer>{ $$ = $1; } INT <integer>{ $$ = $2 + $3; } INT { $$ = $4 + $5; };
n: INT | INT <integer>{ } INT <integer>{ } INT { };
o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:776"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:776"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:776"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_trace "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.10-32: warning: unset value: \$\$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: \$1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: \$3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: \$5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.14-20: warning: unset value: \$\$ [-Wmidrule-values]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~
input.y:14.26-41: warning: unset value: \$\$ [-Wmidrule-values]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~
input.y:14.10-62: warning: unset value: \$\$ [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: \$3 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: \$5 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:15.14-16: warning: unset value: \$\$ [-Wmidrule-values]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.10-49: warning: unset value: \$\$ [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: \$3 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: \$5 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: \$\$ [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: \$3 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:16.27-29: warning: unused value: \$5 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:18.10-58: warning: unset value: \$\$ [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: \$1 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.14-29: warning: unused value: \$2 [-Wmidrule-values]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.31-33: warning: unused value: \$3 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.35-50: warning: unused value: \$4 [-Wmidrule-values]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.52-54: warning: unused value: \$5 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: \$\$ [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: \$1 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: \$3 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.35-64: warning: unused value: \$4 [-Wmidrule-values]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.66-68: warning: unused value: \$5 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:21.18-37: warning: unused value: \$3 [-Wmidrule-values]
21 | j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
| ^~~~~~~~~~~~~~~~~~~~
input.y:22.10-68: warning: unset value: \$\$ [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: \$1 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: \$2 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.35-64: warning: unused value: \$4 [-Wmidrule-values]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.23-25: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: \$1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: \$2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: \$3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: \$4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: \$5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
input.y:26.40-42: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:12.10-32: warning: unset value: $$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: $3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: $5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.14-20: warning: unset value: $$ [-Wmidrule-values]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~
input.y:14.26-41: warning: unset value: $$ [-Wmidrule-values]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~
input.y:14.10-62: warning: unset value: $$ [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $3 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: $5 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:15.14-16: warning: unset value: $$ [-Wmidrule-values]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.10-49: warning: unset value: $$ [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $3 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: $5 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: $$ [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $3 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:16.27-29: warning: unused value: $5 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:18.10-58: warning: unset value: $$ [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $1 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.14-29: warning: unused value: $2 [-Wmidrule-values]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.31-33: warning: unused value: $3 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.35-50: warning: unused value: $4 [-Wmidrule-values]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.52-54: warning: unused value: $5 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: $$ [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $1 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: $3 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.35-64: warning: unused value: $4 [-Wmidrule-values]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.66-68: warning: unused value: $5 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:21.18-37: warning: unused value: $3 [-Wmidrule-values]
21 | j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
| ^~~~~~~~~~~~~~~~~~~~
input.y:22.10-68: warning: unset value: $$ [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $1 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: $2 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.35-64: warning: unused value: $4 [-Wmidrule-values]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.23-25: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: $2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: $3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: $4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: $5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
input.y:26.40-42: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:776"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:776: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" "input.at:776"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:776"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_15
#AT_START_16
at_fn_group_banner 16 'input.at:784' \
"Unused values before symbol declarations" " " 2
at_xfail=no
(
printf "%s\n" "16. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
start:
'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
| 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
| 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
| 'm' m { $2; } | 'n' n { $2; } | 'o' o { $2; }
;
a: INT | INT { } INT { } INT { };
b: INT | %empty;
c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
d: INT | INT { } INT { $1; } INT { $<integer>2; };
e: INT | INT { } INT { } INT { $1; };
f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
m: INT | INT <integer>{ $$ = $1; } INT <integer>{ $$ = $2 + $3; } INT { $$ = $4 + $5; };
n: INT | INT <integer>{ } INT <integer>{ } INT { };
o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l m n o;
%destructor { destroy ($$); } <integer>;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:785"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:785"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:785"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.10-32: warning: unset value: \$\$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: \$1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: \$3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: \$5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.10-62: warning: unset value: \$\$ [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: \$3 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: \$5 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:15.10-49: warning: unset value: \$\$ [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: \$3 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: \$5 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: \$\$ [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: \$3 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:16.27-29: warning: unused value: \$5 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:18.10-58: warning: unset value: \$\$ [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: \$1 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.31-33: warning: unused value: \$3 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.52-54: warning: unused value: \$5 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: \$\$ [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: \$1 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: \$3 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.66-68: warning: unused value: \$5 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:22.10-68: warning: unset value: \$\$ [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: \$1 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: \$2 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:25.23-25: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: \$1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: \$2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: \$3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: \$4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: \$5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
input.y:26.40-42: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:12.10-32: warning: unset value: $$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: $3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: $5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.10-62: warning: unset value: $$ [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $3 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: $5 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:15.10-49: warning: unset value: $$ [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $3 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: $5 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: $$ [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $3 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:16.27-29: warning: unused value: $5 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:18.10-58: warning: unset value: $$ [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $1 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.31-33: warning: unused value: $3 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.52-54: warning: unused value: $5 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: $$ [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $1 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: $3 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.66-68: warning: unused value: $5 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:22.10-68: warning: unset value: $$ [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $1 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: $2 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:25.23-25: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: $2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: $3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: $4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: $5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
input.y:26.40-42: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:785"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:785: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:785"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:785"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%%
start:
'a' a { $2; } | 'b' b { $2; } | 'c' c { $2; } | 'd' d { $2; }
| 'e' e { $2; } | 'f' f { $2; } | 'g' g { $2; } | 'h' h { $2; }
| 'i' i { $2; } | 'j' j { $2; } | 'k' k { $2; } | 'l' l { $2; }
| 'm' m { $2; } | 'n' n { $2; } | 'o' o { $2; }
;
a: INT | INT { } INT { } INT { };
b: INT | %empty;
c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
d: INT | INT { } INT { $1; } INT { $<integer>2; };
e: INT | INT { } INT { } INT { $1; };
f: INT | INT { } INT { } INT { $$ = $1 + $3 + $5; };
g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
i: INT | INT INT { } { $$ = $1 + $2; };
j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
l: INT | INT { $<integer>$ = $<integer>1; } INT { $<integer>$ = $<integer>2 + $<integer>3; } INT { $<integer>$ = $<integer>4 + $<integer>5; };
m: INT | INT <integer>{ $$ = $1; } INT <integer>{ $$ = $2 + $3; } INT { $$ = $4 + $5; };
n: INT | INT <integer>{ } INT <integer>{ } INT { };
o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
%token <integer> INT;
%type <integer> a b c d e f g h i j k l m n o;
%destructor { destroy ($$); } <integer>;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y" "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:786"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:786"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:786"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y"
at_fn_check_prepare_trace "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.10-32: warning: unset value: \$\$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: \$1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: \$3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: \$5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.14-20: warning: unset value: \$\$ [-Wmidrule-values]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~
input.y:14.26-41: warning: unset value: \$\$ [-Wmidrule-values]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~
input.y:14.10-62: warning: unset value: \$\$ [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: \$3 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: \$5 [-Wother]
14 | c: INT | INT { \$1; } INT { \$<integer>2; } INT { \$<integer>4; };
| ^~~
input.y:15.14-16: warning: unset value: \$\$ [-Wmidrule-values]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.10-49: warning: unset value: \$\$ [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: \$3 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: \$5 [-Wother]
15 | d: INT | INT { } INT { \$1; } INT { \$<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: \$\$ [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: \$3 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:16.27-29: warning: unused value: \$5 [-Wother]
16 | e: INT | INT { } INT { } INT { \$1; };
| ^~~
input.y:18.10-58: warning: unset value: \$\$ [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: \$1 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.14-29: warning: unused value: \$2 [-Wmidrule-values]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.31-33: warning: unused value: \$3 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:18.35-50: warning: unused value: \$4 [-Wmidrule-values]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.52-54: warning: unused value: \$5 [-Wother]
18 | g: INT | INT { \$<integer>\$; } INT { \$<integer>\$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: \$\$ [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: \$1 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: \$3 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:19.35-64: warning: unused value: \$4 [-Wmidrule-values]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.66-68: warning: unused value: \$5 [-Wother]
19 | h: INT | INT { \$<integer>\$; } INT { \$<integer>\$ = \$<integer>2; } INT { };
| ^~~
input.y:21.18-37: warning: unused value: \$3 [-Wmidrule-values]
21 | j: INT | INT INT { \$<integer>\$ = 1; } { \$\$ = \$1 + \$2; };
| ^~~~~~~~~~~~~~~~~~~~
input.y:22.10-68: warning: unset value: \$\$ [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: \$1 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: \$2 [-Wother]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~
input.y:22.35-64: warning: unused value: \$4 [-Wmidrule-values]
22 | k: INT | INT INT { \$<integer>\$; } { \$<integer>\$ = \$<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.23-25: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: \$\$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: \$1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: \$2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: \$3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: \$4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: \$5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
input.y:26.40-42: warning: unset value: \$\$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { \$\$ = \$1 + \$2 + \$3 + \$4 + \$5; };
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror" "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:12.10-32: warning: unset value: $$ [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~
input.y:12.10-12: warning: unused value: $1 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.18-20: warning: unused value: $3 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:12.26-28: warning: unused value: $5 [-Wother]
12 | a: INT | INT { } INT { } INT { };
| ^~~
input.y:13.10-15: warning: empty rule for typed nonterminal, and no action [-Wother]
13 | b: INT | %empty;
| ^~~~~~
input.y:14.14-20: warning: unset value: $$ [-Wmidrule-values]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~
input.y:14.26-41: warning: unset value: $$ [-Wmidrule-values]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~
input.y:14.10-62: warning: unset value: $$ [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:14.22-24: warning: unused value: $3 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:14.43-45: warning: unused value: $5 [-Wother]
14 | c: INT | INT { $1; } INT { $<integer>2; } INT { $<integer>4; };
| ^~~
input.y:15.14-16: warning: unset value: $$ [-Wmidrule-values]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.10-49: warning: unset value: $$ [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:15.18-20: warning: unused value: $3 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:15.30-32: warning: unused value: $5 [-Wother]
15 | d: INT | INT { } INT { $1; } INT { $<integer>2; };
| ^~~
input.y:16.10-37: warning: unset value: $$ [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:16.18-20: warning: unused value: $3 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:16.27-29: warning: unused value: $5 [-Wother]
16 | e: INT | INT { } INT { } INT { $1; };
| ^~~
input.y:18.10-58: warning: unset value: $$ [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:18.10-12: warning: unused value: $1 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.14-29: warning: unused value: $2 [-Wmidrule-values]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.31-33: warning: unused value: $3 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:18.35-50: warning: unused value: $4 [-Wmidrule-values]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~~~~~~~~~~~~~~
input.y:18.52-54: warning: unused value: $5 [-Wother]
18 | g: INT | INT { $<integer>$; } INT { $<integer>$; } INT { };
| ^~~
input.y:19.10-72: warning: unset value: $$ [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.10-12: warning: unused value: $1 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.31-33: warning: unused value: $3 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:19.35-64: warning: unused value: $4 [-Wmidrule-values]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:19.66-68: warning: unused value: $5 [-Wother]
19 | h: INT | INT { $<integer>$; } INT { $<integer>$ = $<integer>2; } INT { };
| ^~~
input.y:21.18-37: warning: unused value: $3 [-Wmidrule-values]
21 | j: INT | INT INT { $<integer>$ = 1; } { $$ = $1 + $2; };
| ^~~~~~~~~~~~~~~~~~~~
input.y:22.10-68: warning: unset value: $$ [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:22.10-12: warning: unused value: $1 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.14-16: warning: unused value: $2 [-Wother]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~
input.y:22.35-64: warning: unused value: $4 [-Wmidrule-values]
22 | k: INT | INT INT { $<integer>$; } { $<integer>$ = $<integer>3; } { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.23-25: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.10-50: warning: unset value: $$ [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:25.10-12: warning: unused value: $1 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.23-25: warning: unused value: $2 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.27-29: warning: unused value: $3 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.40-42: warning: unused value: $4 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:25.44-46: warning: unused value: $5 [-Wother]
25 | n: INT | INT <integer>{ } INT <integer>{ } INT { };
| ^~~
input.y:26.23-25: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
input.y:26.40-42: warning: unset value: $$ [-Wother]
26 | o: INT | INT <integer>{ } INT <integer>{ } INT { $$ = $1 + $2 + $3 + $4 + $5; };
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:786"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error" "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:786: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none" "input.at:786"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --warnings=midrule-values -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:786"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_16
#AT_START_17
at_fn_group_banner 17 'input.at:794' \
"Symbol redeclared" " " 2
at_xfail=no
(
printf "%s\n" "17. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token FOO FOO
%token BAR 12 BAR 12
%token EOF 0 EOF 0
%%
exp: FOO BAR
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:804"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:804"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:804"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.12-14: warning: symbol FOO redeclared [-Wother]
1 | %token FOO FOO
| ^~~
input.y:1.8-10: note: previous declaration
1 | %token FOO FOO
| ^~~
input.y:2.15-17: warning: symbol BAR redeclared [-Wother]
2 | %token BAR 12 BAR 12
| ^~~
input.y:2.8-10: note: previous declaration
2 | %token BAR 12 BAR 12
| ^~~
input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
3 | %token EOF 0 EOF 0
| ^~~
input.y:3.8-10: note: previous declaration
3 | %token EOF 0 EOF 0
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.12-14: warning: symbol FOO redeclared [-Wother]
1 | %token FOO FOO
| ^~~
input.y:1.8-10: note: previous declaration
1 | %token FOO FOO
| ^~~
input.y:2.15-17: warning: symbol BAR redeclared [-Wother]
2 | %token BAR 12 BAR 12
| ^~~
input.y:2.8-10: note: previous declaration
2 | %token BAR 12 BAR 12
| ^~~
input.y:3.14-16: warning: symbol EOF redeclared [-Wother]
3 | %token EOF 0 EOF 0
| ^~~
input.y:3.8-10: note: previous declaration
3 | %token EOF 0 EOF 0
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:804"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:804: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:804"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:804"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_17
#AT_START_18
at_fn_group_banner 18 'input.at:832' \
"EOF redeclared" " " 2
at_xfail=no
(
printf "%s\n" "18. $at_setup_line: testing $at_desc ..."
$at_traceon
# We used to crash when redefining a token after having defined EOF.
# See https://lists.gnu.org/r/bug-bison/2020-08/msg00008.html.
cat >input.y <<'_ATEOF'
%token FOO BAR FOO 0
%%
input: %empty
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:843"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:843"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:843"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.16-18: warning: symbol FOO redeclared [-Wother]
1 | %token FOO BAR FOO 0
| ^~~
input.y:1.8-10: note: previous declaration
1 | %token FOO BAR FOO 0
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.16-18: warning: symbol FOO redeclared [-Wother]
1 | %token FOO BAR FOO 0
| ^~~
input.y:1.8-10: note: previous declaration
1 | %token FOO BAR FOO 0
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:843"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:843: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:843"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:843"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_18
#AT_START_19
at_fn_group_banner 19 'input.at:859' \
"Symbol class redefinition" " " 2
at_xfail=no
(
printf "%s\n" "19. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token FOO
%nterm FOO BAR
%token BAR
%nterm error // The token error cannot be redefined as an nterm.
%%
FOO: BAR
BAR:
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:871: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:871"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: error: symbol FOO redeclared as a nonterminal
2 | %nterm FOO BAR
| ^~~
input.y:1.8-10: note: previous definition
1 | %token FOO
| ^~~
input.y:3.8-10: error: symbol BAR redeclared as a token
3 | %token BAR
| ^~~
input.y:2.12-14: note: previous definition
2 | %nterm FOO BAR
| ^~~
input.y:4.8-12: error: symbol error redeclared as a nonterminal
4 | %nterm error // The token error cannot be redefined as an nterm.
| ^~~~~
input.y:6.1-3: error: rule given for FOO, which is a token
6 | FOO: BAR
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:871"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_19
#AT_START_20
at_fn_group_banner 20 'input.at:899' \
"Default %printer and %destructor redeclared" " " 2
at_xfail=no
(
printf "%s\n" "20. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST([*])
# ------------
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <> <>
%printer { print ($$); } <> <>
%destructor { destroy ($$); } <>
%printer { print ($$); } <>
%%
start: %empty;
%destructor { destroy ($$); } <>;
%printer { print ($$); } <>;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.13-29: error: %destructor redeclaration for <>
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:2.10-24: error: %printer redeclaration for <>
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:4.13-29: error: %destructor redeclaration for <>
4 | %destructor { destroy (\$\$); } <>
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:5.10-24: error: %printer redeclaration for <>
5 | %printer { print (\$\$); } <>
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:11.13-29: error: %destructor redeclaration for <>
11 | %destructor { destroy (\$\$); } <>;
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:12.10-24: error: %printer redeclaration for <>
12 | %printer { print (\$\$); } <>;
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:959"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <> <>
%printer { print ($$); } <> <>
%destructor { destroy ($$); } <>
%printer { print ($$); } <>
%%
start: %empty;
%destructor { destroy ($$); } <>;
%printer { print ($$); } <>;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:960: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:960"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.13-29: error: %destructor redeclaration for <>
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:2.10-24: error: %printer redeclaration for <>
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:4.13-29: error: %destructor redeclaration for <>
4 | %destructor { destroy (\$\$); } <>
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:5.10-24: error: %printer redeclaration for <>
5 | %printer { print (\$\$); } <>
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
input.y:11.13-29: error: %destructor redeclaration for <>
11 | %destructor { destroy (\$\$); } <>;
| ^~~~~~~~~~~~~~~~~
input.y:1.13-29: note: previous declaration
1 | %destructor { destroy (\$\$); } <> <>
| ^~~~~~~~~~~~~~~~~
input.y:12.10-24: error: %printer redeclaration for <>
12 | %printer { print (\$\$); } <>;
| ^~~~~~~~~~~~~~~
input.y:2.10-24: note: previous declaration
2 | %printer { print (\$\$); } <> <>
| ^~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:960"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_20
#AT_START_21
at_fn_group_banner 21 'input.at:970' \
"Per-type %printer and %destructor redeclared" " " 2
at_xfail=no
(
printf "%s\n" "21. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <field1> <field2>
%printer { print ($$); } <field1> <field2>
%destructor { destroy ($$); } <field1> <field1>
%printer { print ($$); } <field2> <field2>
%%
start: %empty;
%destructor { destroy ($$); } <field2> <field1>;
%printer { print ($$); } <field2> <field1>;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:987: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:987"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29: note: previous declaration
input.y:4.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29: note: previous declaration
input.y:5.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24: note: previous declaration
input.y:5.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24: note: previous declaration
input.y:11.13-29: error: %destructor redeclaration for <field2>
input.y:1.13-29: note: previous declaration
input.y:11.13-29: error: %destructor redeclaration for <field1>
input.y:1.13-29: note: previous declaration
input.y:12.10-24: error: %printer redeclaration for <field2>
input.y:2.10-24: note: previous declaration
input.y:12.10-24: error: %printer redeclaration for <field1>
input.y:2.10-24: note: previous declaration
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:987"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_21
#AT_START_22
at_fn_group_banner 22 'input.at:1013' \
"Undefined symbols" " " 2
at_xfail=no
(
printf "%s\n" "22. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%printer {} foo baz
%destructor {} bar
%type <foo> qux
%%
exp: bar;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1023: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1023"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.13-15: warning: symbol 'foo' is used, but is not defined as a token and has no rules [-Wother]
1 | %printer {} foo baz
| ^~~
input.y:1.17-19: warning: symbol 'baz' is used, but is not defined as a token and has no rules [-Wother]
1 | %printer {} foo baz
| ^~~
input.y:2.16-18: error: symbol 'bar' is used, but is not defined as a token and has no rules
2 | %destructor {} bar
| ^~~
input.y:3.13-15: warning: symbol 'qux' is used, but is not defined as a token and has no rules [-Wother]
3 | %type <foo> qux
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1023"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_22
#AT_START_23
at_fn_group_banner 23 'input.at:1045' \
"Unassociated types used for a printer or destructor" "" 2
at_xfail=no
(
printf "%s\n" "23. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token <type1> tag1
%type <type2> tag2
%printer { } <type1> <type3>
%destructor { } <type2> <type4>
%%
exp: tag1 { $1; }
| tag2 { $1; }
tag2: "a" { $$; }
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1062"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1062"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1062"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.22-28: warning: type <type3> is used, but is not associated to any symbol [-Wother]
input.y:5.25-31: warning: type <type4> is used, but is not associated to any symbol [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:4.22-28: warning: type <type3> is used, but is not associated to any symbol [-Wother]
input.y:5.25-31: warning: type <type4> is used, but is not associated to any symbol [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1062"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1062"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_23
#AT_START_24
at_fn_group_banner 24 'input.at:1074' \
"Useless printers or destructors" " " 2
at_xfail=no
(
printf "%s\n" "24. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST([INPUT], [STDERR])
# --------------------------
cat >input.y <<'_ATEOF'
%token <type1> token1
%token <type2> token2
%token <type3> token3
%token <type4> token4
%token <type5> token51 token52
%token <type6> token61 token62
%token <type7> token7
%printer {} token1
%destructor {} token2
%printer {} token51
%destructor {} token61
%printer {} token7
%printer {} <type1>
%destructor {} <type2>
%printer {} <type3>
%destructor {} <type4>
%printer {} <type5>
%destructor {} <type6>
%destructor {} <type7>
%%
exp: "a";
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1085"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1085"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1085"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:16.13-19: warning: useless %printer for type <type1> [-Wother]
input.y:17.16-22: warning: useless %destructor for type <type2> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:16.13-19: warning: useless %printer for type <type1> [-Wother]
input.y:17.16-22: warning: useless %destructor for type <type2> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1085"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1085: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1085"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1085"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# If everybody is typed, <> is useless.
cat >input.y <<'_ATEOF'
%type <type> exp
%token <type> a
%printer {} <> <*>
%%
exp: a;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1116"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.13-14: warning: useless %printer for type <> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:3.13-14: warning: useless %printer for type <> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1116"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# If nobody is typed, <*> is useless.
cat >input.y <<'_ATEOF'
%token a
%printer {} <> <*>
%%
exp: a;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1124"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1124"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1124"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.16-18: warning: useless %printer for type <*> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.16-18: warning: useless %printer for type <*> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1124"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1124: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1124"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1124"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_24
#AT_START_25
at_fn_group_banner 25 'input.at:1139' \
"Unused values with default %destructor" " " 2
at_xfail=no
(
printf "%s\n" "25. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <>
%type <tag> tagged
%%
start: end end tagged tagged { $<tag>1; $3; } ;
end: { } ;
tagged: { } ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1152"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1152"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1152"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:6.8-45: warning: unset value: \$\$ [-Wother]
6 | start: end end tagged tagged { \$<tag>1; \$3; } ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: \$2 [-Wother]
6 | start: end end tagged tagged { \$<tag>1; \$3; } ;
| ^~~
input.y:7.6-8: warning: unset value: \$\$ [-Wother]
7 | end: { } ;
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:6.8-45: warning: unset value: $$ [-Wother]
6 | start: end end tagged tagged { $<tag>1; $3; } ;
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother]
6 | start: end end tagged tagged { $<tag>1; $3; } ;
| ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother]
7 | end: { } ;
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1152"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1152: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1152"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1152"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <*>
%type <tag> tagged
%%
start: end end tagged tagged { $<tag>1; $3; } ;
end: { } ;
tagged: { } ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1175"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1175"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1175"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:6.23-28: warning: unused value: \$4 [-Wother]
input.y:8.9-11: warning: unset value: \$\$ [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:6.23-28: warning: unused value: $4 [-Wother]
input.y:8.9-11: warning: unset value: $$ [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1175"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1175: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1175"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1175"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_25
#AT_START_26
at_fn_group_banner 26 'input.at:1187' \
"Unused values with per-type %destructor" " " 2
at_xfail=no
(
printf "%s\n" "26. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%destructor { destroy ($$); } <field1>
%type <field1> start end
%%
start: end end { $1; } ;
end: { } ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1199"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1199"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1199"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:6.8-22: warning: unset value: \$\$ [-Wother]
6 | start: end end { \$1; } ;
| ^~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: \$2 [-Wother]
6 | start: end end { \$1; } ;
| ^~~
input.y:7.6-8: warning: unset value: \$\$ [-Wother]
7 | end: { } ;
| ^~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:6.8-22: warning: unset value: $$ [-Wother]
6 | start: end end { $1; } ;
| ^~~~~~~~~~~~~~~
input.y:6.12-14: warning: unused value: $2 [-Wother]
6 | start: end end { $1; } ;
| ^~~
input.y:7.6-8: warning: unset value: $$ [-Wother]
7 | end: { } ;
| ^~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1199"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1199: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1199"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1199"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_26
#AT_START_27
at_fn_group_banner 27 'input.at:1219' \
"Duplicate string" " " 2
at_xfail=no
(
printf "%s\n" "27. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
/* 'Bison -v' used to dump core when two tokens are defined with the same
string, as LE and GE below. */
%token NUM
%token LE "<="
%token GE "<="
%%
exp: '(' exp ')' | NUM ;
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1236"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1236"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1236"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:6.11-14: warning: symbol \"<=\" used more than once as a literal string [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror" "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:6.11-14: warning: symbol "<=" used more than once as a literal string [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1236"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error" "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none" "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1236: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none" "input.at:1236"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1236"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_27
#AT_START_28
at_fn_group_banner 28 'input.at:1247' \
"Token collisions" " " 2
at_xfail=no
(
printf "%s\n" "28. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token FOO 42 "foo"
BAR 42 "foo"
%%
exp: FOO BAR;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1256: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1256"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.17-21: warning: symbol \"foo\" used more than once as a literal string [-Wother]
2 | BAR 42 \"foo\"
| ^~~~~
input.y:2.10-12: error: code 42 reassigned to token BAR
2 | BAR 42 \"foo\"
| ^~~
input.y:1.15-19: note: previous declaration for \"foo\"
1 | %token FOO 42 \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1256"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_28
#AT_START_29
at_fn_group_banner 29 'input.at:1275' \
"Incompatible Aliases" " " 2
at_xfail=no
(
printf "%s\n" "29. $at_setup_line: testing $at_desc ..."
$at_traceon
# Use the string-alias first to check the order between "first
# declaration" and second.
cat >input.y <<'_ATEOF'
%token foo "foo"
%type <bar> "foo"
%type <baz> foo
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1285: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1285"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.13-15: error: %type redeclaration for foo
3 | %type <baz> foo
| ^~~
input.y:2.13-17: note: previous declaration
2 | %type <bar> \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1285"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%token foo "foo"
%printer {bar} "foo"
%printer {baz} foo
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1299: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1299"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.10-14: error: %printer redeclaration for foo
3 | %printer {baz} foo
| ^~~~~
input.y:2.10-14: note: previous declaration
2 | %printer {bar} \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1299"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%token foo "foo"
%destructor {bar} "foo"
%destructor {baz} foo
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1313: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1313"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.13-17: error: %destructor redeclaration for foo
3 | %destructor {baz} foo
| ^~~~~
input.y:2.13-17: note: previous declaration
2 | %destructor {bar} \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1313"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%token foo "foo"
%left "foo"
%left foo
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-5: error: %left redeclaration for foo
3 | %left foo
| ^~~~~
input.y:2.1-5: note: previous declaration
2 | %left \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1327"
$at_failed && at_fn_log_failure
$at_traceon; }
# This time, declare the alias after its use.
# Precedence/associativity.
cat >input.y <<'_ATEOF'
%left "foo"
%left foo
%token foo "foo"
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1344: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1344"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-5: error: %left redeclaration for foo
2 | %left foo
| ^~~~~
input.y:1.1-5: note: previous declaration
1 | %left \"foo\"
| ^~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Printer.
cat >input.y <<'_ATEOF'
%printer {} "foo"
%printer {} foo
%token foo "foo"
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.10-11: error: %printer redeclaration for foo
2 | %printer {} foo
| ^~
input.y:1.10-11: note: previous declaration
1 | %printer {} \"foo\"
| ^~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1359"
$at_failed && at_fn_log_failure
$at_traceon; }
# Destructor.
cat >input.y <<'_ATEOF'
%destructor {} "foo"
%destructor {} foo
%token foo "foo"
%%
exp: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.13-14: error: %destructor redeclaration for foo
2 | %destructor {} foo
| ^~
input.y:1.13-14: note: previous declaration
1 | %destructor {} \"foo\"
| ^~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_29
#AT_START_30
at_fn_group_banner 30 'input.at:1400' \
"Torturing the Scanner" " " 2
at_xfail=no
(
printf "%s\n" "30. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
{}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1407: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:1407"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-2: error: unexpected {...}
1 | {}
| ^~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Clang chokes on some of our comments, because it tries to "parse"
# some documentation directives in the comments:
#
# input.c:166:50: error: '\a' command does not have a valid word argument [-Werror,-Wdocumentation]
# FAKE = 258 /* "fake [] \a\b\f\n\r\t\v\"'?\\[\\ ??!??'??(??)??-??/??<??=??> \001\001" */
# ~~^
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#if defined __clang__ && 10 <= __clang_major__
# pragma clang diagnostic ignored "-Wdocumentation"
#endif
}
%{
/* This is seen in GCC: a %{ and %} in middle of a comment. */
const char *foo = "So %{ and %} can be here too.";
#if 0
/* These examples test Bison while not stressing C compilers too much.
Many C compilers mishandle backslash-newlines, so this part of the
test is inside "#if 0". The comment and string are written so that
the "#endif" will be seen regardless of the C compiler bugs that we
know about, namely:
HP C (as of late 2002) mishandles *\[newline]\[newline]/ within a
comment.
The Apple Darwin compiler (as of late 2002) mishandles
\\[newline]' within a character constant.
*/
/\
* A comment with backslash-newlines in it. %} *\
\
/
/* { Close the above comment, if the C compiler mishandled it. */
char str[] = "\\
" A string with backslash-newlines in it %{ %} \\
\
"";
char apostrophe = '\'';
#endif
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
%}
/* %{ and %} can be here too. */
%{
/* Exercise pre-prologue dependency to %union. */
typedef int value;
%}
/* Exercise M4 quoting: ']]', 0. */
/* Also exercise %union. */
%union
{
value ival; /* A comment to exercise an old bug. */
};
/* Exercise post-prologue dependency to %union. */
%{
static YYSTYPE value_as_yystype (value val);
/* Exercise quotes in declarations. */
char quote[] = "]],";
%}
%{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
%}
%type <ival> '['
/* Exercise quotes in strings. */
%token FAKE "fake [] \a\b\f\n\r\t\v\"\'\?\\\u005B\U0000005c ??!??'??(??)??-??/??<??=??> \x1\1"
/* Beware of the generated comments that embed string aliases that
might close the comment. */
%token COMMENT_CLOSE "*/"
%token COMMENT "/* comment */"
%%
/* Exercise M4 quoting: ']]', [, 1. */
exp: '[' '\1' two '$' '@' '{' oline output.or.oline.opt
{
/* Exercise quotes in braces. */
char tmp[] = "[%c],\n";
printf (tmp, $1);
}
;
two: '\x000000000000000000000000000000000000000000000000000000000000000000002';
oline: '@' 'o' 'l' 'i' 'n' 'e' '@' '_' '_' 'o' 'l' 'i' 'n' 'e' '_' '_';
output.or.oline.opt: %empty;|oline;;|output;;;
output: '#' 'o' 'u' 't' 'p' 'u' 't' ' ';
%%
/* Exercise M4 quoting: ']]', [, 2. */
static YYSTYPE
value_as_yystype (value val)
{
YYSTYPE res;
res.ival = val;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static char const input[] = "[\1\2$@{@oline@__oline__\
#output "; /* "
*/
enum { input_elts = sizeof input };
(void) input_elts;
static int toknum;
assert (0 <= toknum && toknum < input_elts);
yylval = value_as_yystype (input[toknum]);
return input[toknum++];
}
_ATEOF
# Pacify Emacs'font-lock-mode: "
cat >main.c <<'_ATEOF'
typedef int value;
#include "input.h"
int yyparse (void);
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1554"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "input.at:1554"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1554"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1554"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1554"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1554: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "input.at:1554"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1554"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "input.at:1555" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:1555"
{ set +x
printf "%s\n" "$at_srcdir/input.at:1555: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:1555"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1555"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "input.at:1556" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:1556"
{ set +x
printf "%s\n" "$at_srcdir/input.at:1556: \$CC \$CFLAGS \$CPPFLAGS -c -o main.o main.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o main.o main.c " "input.at:1556"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o main.o main.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1556"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "input.at:1557" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:1557"
{ set +x
printf "%s\n" "$at_srcdir/input.at:1557: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.o main.o \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS" "input.at:1557"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.o main.o $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1557"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1558: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:1558"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "[[],
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1558"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1558: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "input.at:1558"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1558"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_30
#AT_START_31
at_fn_group_banner 31 'input.at:1569' \
"Typed symbol aliases" " " 2
at_xfail=no
(
printf "%s\n" "31. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison 2.0 broke typed symbol aliases - ensure they work.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%union
{
int val;
};
%token <val> MY_TOKEN "MY TOKEN"
%type <val> exp
%%
exp: "MY TOKEN";
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1586"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1586"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1586"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1586"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1586"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1586: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1586"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_31
#AT_START_32
at_fn_group_banner 32 'input.at:1609' \
"Require 1.0" " " 2
at_xfail=no
(
printf "%s\n" "32. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%require "1.0";
%%
empty_file: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1609"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1609"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1609"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1609"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1609"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1609: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1609"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1609"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_32
#AT_START_33
at_fn_group_banner 33 'input.at:1610' \
"Require 3.8.2" " " 2
at_xfail=no
(
printf "%s\n" "33. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%require "3.8.2";
%%
empty_file: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1610"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1610"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1610"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1610"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1610"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1610: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1610"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1610"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_33
#AT_START_34
at_fn_group_banner 34 'input.at:1612' \
"Require 100.0" " " 2
at_xfail=no
(
printf "%s\n" "34. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%require "100.0";
%%
empty_file: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1612: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "input.at:1612"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 63 $at_status "$at_srcdir/input.at:1612"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_34
#AT_START_35
at_fn_group_banner 35 'input.at:1619' \
"String aliases for character tokens" " " 2
at_xfail=no
(
printf "%s\n" "35. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison once thought a character token and its alias were different
# symbols with the same code.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token 'a' "a"
%%
start: 'a';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1632"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1632"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1632"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1632"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_35
#AT_START_36
at_fn_group_banner 36 'input.at:1642' \
"Symbols" " " 2
at_xfail=no
(
printf "%s\n" "36. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token WITH-DASH
%token WITHOUT_DASH "WITHOUT-DASH"
%token WITH.PERIOD
%token WITHOUT_PERIOD "WITHOUT.PERIOD"
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
start: with-dash without_dash with.period without_period;
with-dash: WITH-DASH;
without_dash: "WITHOUT-DASH";
with.period: WITH.PERIOD;
without_period: "WITHOUT.PERIOD";
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
# POSIX Yacc accept periods, but not dashes.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --yacc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --yacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y" "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --yacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1666"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1666"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1666"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --yacc input.y"
at_fn_check_prepare_trace "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --yacc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc]
input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc]
input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Werror" "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
input.y:9.8-16: warning: POSIX Yacc forbids dashes in symbol names: WITH-DASH [-Wyacc]
input.y:10.21-34: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:12.23-38: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:13.1-5: warning: POSIX Yacc does not support %code [-Wyacc]
input.y:20.8-16: warning: POSIX Yacc forbids dashes in symbol names: with-dash [-Wyacc]
input.y:22.15-28: warning: POSIX Yacc does not support string literals [-Wyacc]
input.y:24.17-32: warning: POSIX Yacc does not support string literals [-Wyacc]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1666"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=error" "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none" "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1666: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none" "input.at:1666"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --yacc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1666"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# Dashes are fine for GNU Bison.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1678"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1678"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1678"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1678"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1678"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1678: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1678"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1678"
$at_failed && at_fn_log_failure
$at_traceon; }
# Make sure we don't export silly token identifiers with periods or dashes.
printf "%s\n" "input.at:1681" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:1681"
{ set +x
printf "%s\n" "$at_srcdir/input.at:1681: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "input.at:1681"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1681"
$at_failed && at_fn_log_failure
$at_traceon; }
# Periods are genuine letters, they can start identifiers.
# Digits and dashes cannot.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token .GOOD
-GOOD
1NV4L1D
-123
%%
start: .GOOD GOOD
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1694: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "input.at:1694"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:10.10: error: invalid character: '-'
input.y:11.10-16: error: invalid identifier: '1NV4L1D'
input.y:12.10: error: invalid character: '-'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1694"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_36
#AT_START_37
at_fn_group_banner 37 'input.at:1708' \
"Numbered tokens" " " 2
at_xfail=no
(
printf "%s\n" "37. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >redecl.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token DECIMAL_1 11259375
HEXADECIMAL_1 0xabcdef
HEXADECIMAL_2 0xFEDCBA
DECIMAL_2 16702650
%%
start: DECIMAL_1 HEXADECIMAL_2;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1720: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y" "input.at:1720"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret redecl.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "redecl.y:10.10-22: error: code 11259375 reassigned to token HEXADECIMAL_1
redecl.y:9.8-16: note: previous declaration for DECIMAL_1
redecl.y:12.10-18: error: code 16702650 reassigned to token DECIMAL_2
redecl.y:11.10-22: note: previous declaration for HEXADECIMAL_2
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1720"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >too-large.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token TOO_LARGE_DEC 999999999999999999999
TOO_LARGE_HEX 0xFFFFFFFFFFFFFFFFFFF
%%
start: TOO_LARGE_DEC TOO_LARGE_HEX
%%
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1735: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y" "input.at:1735"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret too-large.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "too-large.y:9.22-42: error: integer out of range: '999999999999999999999'
too-large.y:9.22-42: error: code of token TOO_LARGE_DEC too large
too-large.y:10.24-44: error: integer out of range: '0xFFFFFFFFFFFFFFFFFFF'
too-large.y:10.24-44: error: code of token TOO_LARGE_HEX too large
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1735"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_37
#AT_START_38
at_fn_group_banner 38 'input.at:1750' \
"Unclosed constructs" " " 2
at_xfail=no
(
printf "%s\n" "38. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison's scan-gram.l once forgot to STRING_FINISH () some unclosed
# constructs, so they were prepended to whatever it STRING_GROW ()'ed
# next. It also threw them away rather than returning them to the
# parser. The effect was confusing subsequent error messages.
cat >input.y <<'_ATEOF'
%token A "a
%token B "b"
%token AB "ab" // Used to complain that "ab" was already used.
%token C '1
%token TWO "2"
%token TICK_TWELVE "'12" // Used to complain that "'12" was already used.
%%
start: %empty;
// Used to report a syntax error because it didn't see any kind of symbol
// identifier.
%type <f> 'a
;
%type <f> "a
;
// Used to report a syntax error because it didn't see braced code.
%destructor { free ($$)
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1779: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "input.at:1779"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.10-2.0: error: missing '\"' at end of line
1 | %token A \"a
| ^~
input.y:4.10-5.0: error: missing \"'\" at end of line
4 | %token C '1
| ^~
input.y:14.11-15.0: error: missing \"'\" at end of line
14 | %type <f> 'a
| ^~
input.y:16.11-17.0: error: missing '\"' at end of line
16 | %type <f> \"a
| ^~
input.y:19.13-20.0: error: missing '}' at end of file
19 | %destructor { free (\$\$)
| ^~~~~~~~~~~
input.y:20.1: error: unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1779"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_38
#AT_START_39
at_fn_group_banner 39 'input.at:1805' \
"%start after first rule" " " 2
at_xfail=no
(
printf "%s\n" "39. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison once complained that a %start after the first rule was a
# redeclaration of the start symbol.
cat >input.y <<'_ATEOF'
%%
false_start: %empty;
start: false_start ;
%start start;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1817"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:1817"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1817"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1817"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1817"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1817: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:1817"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1817"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_39
#AT_START_40
at_fn_group_banner 40 'input.at:1826' \
"Duplicate %start symbol" " " 2
at_xfail=no
(
printf "%s\n" "40. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%start exp exp exp
%%
exp: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1836"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1836"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1836"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.12-14: warning: duplicate directive [-Wother]
1 | %start exp exp exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp exp exp
| ^~~
input.y:1.16-18: warning: duplicate directive [-Wother]
1 | %start exp exp exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp exp exp
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.12-14: warning: duplicate directive [-Wother]
1 | %start exp exp exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp exp exp
| ^~~
input.y:1.16-18: warning: duplicate directive [-Wother]
1 | %start exp exp exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp exp exp
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1836"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1836: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1836"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%start exp foo exp
%%
exp: foo;
foo: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1859"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1859"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1859"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.16-18: warning: duplicate directive [-Wother]
1 | %start exp foo exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp foo exp
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:1.16-18: warning: duplicate directive [-Wother]
1 | %start exp foo exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp foo exp
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1859"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1859: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1859"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1859"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%start exp foo
%start exp
%%
exp: foo;
foo: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1877"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1877"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1877"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: warning: duplicate directive [-Wother]
2 | %start exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp foo
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.8-10: warning: duplicate directive [-Wother]
2 | %start exp
| ^~~
input.y:1.8-10: note: previous declaration
1 | %start exp foo
| ^~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1877"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1877: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:1877"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1877"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_40
#AT_START_41
at_fn_group_banner 41 'input.at:1895' \
"%prec takes a token" " " 2
at_xfail=no
(
printf "%s\n" "41. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison once allowed %prec sym where sym was a nonterminal.
cat >input.y <<'_ATEOF'
%%
start: PREC %prec PREC ;
PREC: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1905: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:1905"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-4: error: rule given for PREC, which is a token
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_41
#AT_START_42
at_fn_group_banner 42 'input.at:1916' \
"%prec's token must be defined" " " 2
at_xfail=no
(
printf "%s\n" "42. $at_setup_line: testing $at_desc ..."
$at_traceon
# According to POSIX, a %prec token must be defined separately.
cat >input.y <<'_ATEOF'
%%
start: %prec PREC ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1925"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:1925"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:1925"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-17: warning: token for %prec is not defined: PREC [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.8-17: warning: token for %prec is not defined: PREC [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:1925"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:1925: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:1925"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:1925"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_42
#AT_START_43
at_fn_group_banner 43 'input.at:1936' \
"Reject unused %code qualifiers" " " 2
at_xfail=no
(
printf "%s\n" "43. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input-c.y <<'_ATEOF'
%code q {}
%code bad {}
%code bad {}
%code format {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1946: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y" "input.at:1946"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-c.y:1.7: error: %code qualifier 'q' is not used
input-c.y:2.7-9: error: %code qualifier 'bad' is not used
input-c.y:3.7-9: error: %code qualifier 'bad' is not used
input-c.y:4.7-12: error: %code qualifier 'format' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1946"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-c-glr.y <<'_ATEOF'
%code q {}
%code bad {}
%code bad {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1960: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y" "input.at:1960"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c-glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-c-glr.y:1.7: error: %code qualifier 'q' is not used
input-c-glr.y:2.7-9: error: %code qualifier 'bad' is not used
input-c-glr.y:3.8-10: error: %code qualifier 'bad' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1960"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-c++.y <<'_ATEOF'
%code q {}
%code bad {}
%code q {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1973: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y" "input.at:1973"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-c++.y:1.7: error: %code qualifier 'q' is not used
input-c++.y:2.7-9: error: %code qualifier 'bad' is not used
input-c++.y:3.8: error: %code qualifier 'q' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1973"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-c++-glr.y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1986: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y" "input.at:1986"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-c++-glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-c++-glr.y:1.7-9: error: %code qualifier 'bad' is not used
input-c++-glr.y:2.7: error: %code qualifier 'q' is not used
input-c++-glr.y:3.7: error: %code qualifier 'q' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1986"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >special-char-@@.y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:1999: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y" "input.at:1999"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-@@.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "special-char-@@.y:1.7-9: error: %code qualifier 'bad' is not used
special-char-@@.y:2.7: error: %code qualifier 'q' is not used
special-char-@@.y:3.7: error: %code qualifier 'q' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:1999"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >special-char-].y <<'_ATEOF'
%code bad {}
%code q {}
%code q {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2012: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y" "input.at:2012"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret special-char-].y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "special-char-].y:1.7-9: error: %code qualifier 'bad' is not used
special-char-].y:2.7: error: %code qualifier 'q' is not used
special-char-].y:3.7: error: %code qualifier 'q' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2012"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_43
#AT_START_44
at_fn_group_banner 44 'input.at:2025' \
"Multiple %code" " " 2
at_xfail=no
(
printf "%s\n" "44. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure that repeated arguments to %code are separated by
# end-of-lines. At some point, a missing eol would leave synclines
# appended to the previous value. Here, we use CPP directive to
# introduce dependency on the absence/presence of the eol.
cat >input.y <<'_ATEOF'
%code {#include <assert.h>}
%code {#define A B}
%code {#define B C}
%code {#define C D}
%code {#define D 42}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
start: %empty;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
int main (void)
{
assert (A == 42);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "input.at:2054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2054"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2054"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2054"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "input.at:2054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "input.at:2054" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/input.at:2054"
{ set +x
printf "%s\n" "$at_srcdir/input.at:2054: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "input.at:2054"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2055: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "input.at:2055"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2055"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2055: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "input.at:2055"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2055"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_44
#AT_START_45
at_fn_group_banner 45 'input.at:2065' \
"errors" " " 2
at_xfail=no
(
printf "%s\n" "45. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input-redefined.y <<'_ATEOF'
%define var "value1"
%define var "value1"
%define var "value2"
%define special1 "]"
%define special2 "["
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2077: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y" "input.at:2077"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-redefined.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-redefined.y:2.1-20: warning: %define variable 'var' redefined [-Wother]
input-redefined.y:1.1-20: note: previous definition
input-redefined.y:3.2-21: error: %define variable 'var' redefined
input-redefined.y:2.1-20: note: previous definition
input-redefined.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2077"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-unused.y <<'_ATEOF'
%define var "value"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2091: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y" "input.at:2091"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-unused.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-unused.y:1.1-19: error: %define variable 'var' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2091"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_45
#AT_START_46
at_fn_group_banner 46 'input.at:2102' \
"%define, --define, --force-define" " " 2
at_xfail=no
(
printf "%s\n" "46. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >skel.c <<'_ATEOF'
m4_divert_push(0)@
@output(b4_parser_file_name@)@
[var-dd: ]b4_percent_define_get([[var-dd]])[
var-ff: ]b4_percent_define_get([[var-ff]])[
var-dfg: ]b4_percent_define_get([[var-dfg]])[
var-fd: ]b4_percent_define_get([[var-fd]])
m4_divert_pop(0)
_ATEOF
cat >input.y <<'_ATEOF'
%define var-dfg "gram"
%%
start: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \\
--skeleton ./skel.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \
--skeleton ./skel.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \\
--skeleton ./skel.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \
--skeleton ./skel.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2118"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2118"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2118"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \\
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \\
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \\
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \\
--skeleton ./skel.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dvar-dd=cmd-d1 -Dvar-dd=cmd-d2 \
-Fvar-ff=cmd-f1 -Fvar-ff=cmd-f2 \
-Dvar-dfg=cmd-d -Fvar-dfg=cmd-f \
-Fvar-fd=cmd-f -Dvar-fd=cmd-d \
--skeleton ./skel.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2118"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2123: cat input.tab.c"
at_fn_check_prepare_trace "input.at:2123"
( $at_check_trace; cat input.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "var-dd: cmd-d2
var-ff: cmd-f2
var-dfg: cmd-f
var-fd: cmd-d
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2123"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-dg.y <<'_ATEOF'
%define var "gram"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2135: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y" "input.at:2135"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dvar=cmd-d input-dg.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-dg.y:1.1-18: error: %define variable 'var' redefined
<command line>:3: note: previous definition
input-dg.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2135"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-dg.y <<'_ATEOF'
%define var "gram"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y" "input.at:2146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Dvar=cmd-d input-dg.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-dg.y:1.1-18: error: %define variable 'var' redefined
1 | %define var \"gram\"
| ^~~~~~~~~~~~~~~~~~
<command line>:4: note: previous definition
input-dg.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2146"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-unused.y <<'_ATEOF'
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2158: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y" "input.at:2158"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dunused-d -Funused-f input-unused.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:3: error: %define variable 'unused-d' is not used
<command line>:4: error: %define variable 'unused-f' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2158"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_46
#AT_START_47
at_fn_group_banner 47 'input.at:2170' \
"\"%define\" Boolean variables" " " 2
at_xfail=no
(
printf "%s\n" "47. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >Input.y <<'_ATEOF'
%language "Java"
%define api.parser.class {Input}
%define api.parser.public {maybe}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2180: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y" "input.at:2180"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret Input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Input.y:3.1-33: error: invalid value for %define Boolean variable 'api.parser.public'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2180"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_47
#AT_START_48
at_fn_group_banner 48 'input.at:2191' \
"\"%define\" code variables" " " 2
at_xfail=no
(
printf "%s\n" "48. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc" %locations
%define api.location.type quux
%define api.namespace quux
%define api.prefix quux
%define api.token.prefix quux
%token TOK // Otherwise api.token.prefix is unused.
%%
start: TOK;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2213"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2213"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2213"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.yy"
at_fn_check_prepare_trace "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.yy:2.1-30: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.1-30: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.1-30: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.1-30: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.yy:2.1-30: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.1-30: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.1-30: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.1-30: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2213"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2213: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" "input.at:2213"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2213"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.yy <<'_ATEOF'
%skeleton "lalr1.cc" %locations
%define api.location.type "quux"
%define api.namespace "quux"
%define api.prefix "quux"
%define api.token.prefix "quux"
%token TOK // Otherwise api.token.prefix is unused.
%%
start: TOK;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy" "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2214"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2214"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2214"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.yy"
at_fn_check_prepare_trace "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.yy:2.1-32: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.1-32: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.1-32: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.1-32: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror" "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.yy:2.1-32: warning: %define variable 'api.location.type' requires '{...}' values [-Wdeprecated]
input.yy:4.1-32: warning: %define variable 'api.prefix' requires '{...}' values [-Wdeprecated]
input.yy:5.1-32: warning: %define variable 'api.token.prefix' requires '{...}' values [-Wdeprecated]
input.yy:3.1-32: warning: %define variable 'api.namespace' requires '{...}' values [-Wdeprecated]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2214"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error" "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none" "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none" "input.at:2214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.yy --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2214"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_48
#AT_START_49
at_fn_group_banner 49 'input.at:2224' \
"\"%define\" keyword variables" " " 2
at_xfail=no
(
printf "%s\n" "49. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%define api.pure "true"
%define api.push-pull "both"
%define lr.default-reduction "most"
%define lr.keep-unreachable-state "true"
%define lr.type "lalr"
%%
exp: %empty
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2246"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2246"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2246"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2246"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2246"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%define api.pure {true}
%define api.push-pull {both}
%define lr.default-reduction {most}
%define lr.keep-unreachable-state {true}
%define lr.type {lalr}
%%
exp: %empty
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2247"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2247"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2247"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:5.1-40: warning: %define variable 'lr.type' requires keyword values [-Wdeprecated]
input.y:3.1-40: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
input.y:4.1-40: warning: %define variable 'lr.keep-unreachable-state' requires keyword values [-Wdeprecated]
input.y:1.1-38: warning: %define variable 'api.pure' requires keyword values [-Wdeprecated]
input.y:2.1-40: warning: %define variable 'api.push-pull' requires keyword values [-Wdeprecated]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2247"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2247"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_49
#AT_START_50
at_fn_group_banner 50 'input.at:2257' \
"\"%define\" enum variables" " " 2
at_xfail=no
(
printf "%s\n" "50. $at_setup_line: testing $at_desc ..."
$at_traceon
# Check errors from the front-end, and the back-end. Since the
# front-end quits before calling the back-end, these tests cannot be
# fused.
# Front-end.
cat >input.y <<'_ATEOF'
%define lr.default-reduction bogus
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2269: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2269"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-34: error: invalid value for %define variable 'lr.default-reduction': 'bogus'
1 | %define lr.default-reduction bogus
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:1.1-34: note: accepted value: 'most'
input.y:1.1-34: note: accepted value: 'consistent'
input.y:1.1-34: note: accepted value: 'accepting'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2269"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check escapes.
cat >input.y <<'_ATEOF'
%define lr.default-reduction {[$@]}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-35: warning: %define variable 'lr.default-reduction' requires keyword values [-Wdeprecated]
1 | %define lr.default-reduction {[\$@]}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:1.1-35: error: invalid value for %define variable 'lr.default-reduction': '[\$@]'
1 | %define lr.default-reduction {[\$@]}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:1.1-35: note: accepted value: 'most'
input.y:1.1-35: note: accepted value: 'consistent'
input.y:1.1-35: note: accepted value: 'accepting'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2284"
$at_failed && at_fn_log_failure
$at_traceon; }
# Back-end.
cat >input.y <<'_ATEOF'
%define api.push-pull neither
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2303: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2303"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-29: error: invalid value for %define variable 'api.push-pull': 'neither'
1 | %define api.push-pull neither
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y:1.1-29: note: accepted value: 'pull'
input.y:1.1-29: note: accepted value: 'push'
input.y:1.1-29: note: accepted value: 'both'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2303"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_50
#AT_START_51
at_fn_group_banner 51 'input.at:2320' \
"\"%define\" file variables" " " 2
at_xfail=no
(
printf "%s\n" "51. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.cc"
%locations
%define api.location.file {bogus}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2329: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2329"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-33: error: %define variable 'api.location.file' requires 'none' or '\"...\"' values
3 | %define api.location.file {bogus}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2329"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_51
#AT_START_52
at_fn_group_banner 52 'input.at:2342' \
"\"%define\" backward compatibility" " " 2
at_xfail=no
(
printf "%s\n" "52. $at_setup_line: testing $at_desc ..."
$at_traceon
# The error messages tell us whether the variables are properly updated.
cat >input.y <<'_ATEOF'
%define api.push_pull both
%define lr.keep_unreachable_states maybe
%define namespace "foo"
%define variant
%define parser_class_name {parser}
%define filename_type {filename}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2355: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2355"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-26: warning: deprecated directive: '%define api.push_pull both', use '%define api.push-pull both' [-Wdeprecated]
1 | %define api.push_pull both
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
| %define api.push-pull both
input.y:2.1-40: warning: deprecated directive: '%define lr.keep_unreachable_states maybe', use '%define lr.keep-unreachable-state maybe' [-Wdeprecated]
2 | %define lr.keep_unreachable_states maybe
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| %define lr.keep-unreachable-state maybe
input.y:3.1-23: warning: deprecated directive: '%define namespace \"foo\"', use '%define api.namespace {foo}' [-Wdeprecated]
3 | %define namespace \"foo\"
| ^~~~~~~~~~~~~~~~~~~~~~~
| %define api.namespace {foo}
input.y:4.1-15: warning: deprecated directive: '%define variant', use '%define api.value.type variant' [-Wdeprecated]
4 | %define variant
| ^~~~~~~~~~~~~~~
| %define api.value.type variant
input.y:5.1-34: warning: deprecated directive: '%define parser_class_name {parser}', use '%define api.parser.class {parser}' [-Wdeprecated]
5 | %define parser_class_name {parser}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| %define api.parser.class {parser}
input.y:6.1-32: warning: deprecated directive: '%define filename_type {filename}', use '%define api.filename.type {filename}' [-Wdeprecated]
6 | %define filename_type {filename}
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| %define api.filename.type {filename}
input.y:2.1-40: error: invalid value for %define Boolean variable 'lr.keep-unreachable-state'
2 | %define lr.keep_unreachable_states maybe
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2355"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_52
#AT_START_53
at_fn_group_banner 53 'input.at:2393' \
"Unused api.pure" " " 2
at_xfail=no
(
printf "%s\n" "53. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST(DECLS, VALUE, LOCATION)
# -------------------------------
# Make sure Bison reports that '%define api.pure VALUE' is unused when DECLS
# are specified.
cat >input.y <<'_ATEOF'
%define api.pure
%language "c++"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2413: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2413"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-16: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.pure false
%language "c++"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2414: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2414"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-22: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.pure ""
%language "c++" %glr-parser
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2415: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2415"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-19: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2415"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.pure false
%language "c++" %glr-parser
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-22: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.pure true
%language "java"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-21: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.pure false
%language "java"
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2418: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2418"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-22: error: %define variable 'api.pure' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_53
#AT_START_54
at_fn_group_banner 54 'input.at:2429' \
"C++ namespace reference errors" " " 2
at_xfail=no
(
printf "%s\n" "54. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_CHECK_NAMESPACE_ERROR(NAMESPACE-DECL, ERROR, [ERROR], ...)
# -------------------------------------------------------------
# Make sure Bison reports all ERROR's for %define namespace "NAMESPACE-DECL".
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2450: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2450"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-24: error: namespace reference is empty
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2450"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace { }
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2452: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2452"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-57: error: namespace reference is empty
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2452"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {foo::::bar}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2454: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2454"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-34: error: namespace reference has consecutive \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2454"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {foo:: ::bar}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2456: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2456"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-38: error: namespace reference has consecutive \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2456"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {::::bar}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2458: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2458"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-31: error: namespace reference has consecutive \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2458"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {:: ::bar}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2460: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2460"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-32: error: namespace reference has consecutive \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2460"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {foo::bar:: ::}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2462: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2462"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-43: error: namespace reference has consecutive \"::\"
input.y:3.1-43: error: namespace reference has a trailing \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2462"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {foo::bar::}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2465: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2465"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-34: error: namespace reference has a trailing \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2465"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {foo::bar:: }
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2467: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2467"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-41: error: namespace reference has a trailing \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2467"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%language "C++"
%header
%define api.namespace {::}
%%
start: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2469: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2469"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.1-26: error: namespace reference has a trailing \"::\"
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2469"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_54
#AT_START_55
at_fn_group_banner 55 'input.at:2482' \
"Bad character literals" " " 2
at_xfail=no
(
printf "%s\n" "55. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >empty.y <<'_ATEOF'
%%
start: '';
start: '
start: '
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2484:
set x \`LC_ALL=C ls -l 'empty.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='empty.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2484"
( $at_check_trace;
set x `LC_ALL=C ls -l 'empty.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='empty.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2484"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2490: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y" "input.at:2490"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret empty.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "empty.y:2.8-9: error: empty character literal
2 | start: '';
| ^~
empty.y:3.8-4.0: error: missing \"'\" at end of line
3 | start: '
| ^
empty.y:3.8-4.0: error: empty character literal
3 | start: '
| ^
empty.y:4.8: error: missing \"'\" at end of file
4 | start: '
| ^
empty.y:4.8: error: empty character literal
4 | start: '
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2490"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >two.y <<'_ATEOF'
%%
start: 'ab';
start: 'ab
start: 'ab
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2508:
set x \`LC_ALL=C ls -l 'two.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='two.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2508"
( $at_check_trace;
set x `LC_ALL=C ls -l 'two.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='two.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2508"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2514: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y" "input.at:2514"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret two.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "two.y:2.8-11: error: extra characters in character literal
two.y:3.8-4.0: error: missing \"'\" at end of line
two.y:3.8-4.0: error: extra characters in character literal
two.y:4.8-10: error: missing \"'\" at end of file
two.y:4.8-10: error: extra characters in character literal
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2514"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >three.y <<'_ATEOF'
%%
start: 'abc';
start: 'abc
start: 'abc
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2522:
set x \`LC_ALL=C ls -l 'three.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='three.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2522"
( $at_check_trace;
set x `LC_ALL=C ls -l 'three.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='three.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2522"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2528: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y" "input.at:2528"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret three.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "three.y:2.8-12: error: extra characters in character literal
three.y:3.8-4.0: error: missing \"'\" at end of line
three.y:3.8-4.0: error: extra characters in character literal
three.y:4.8-11: error: missing \"'\" at end of file
three.y:4.8-11: error: extra characters in character literal
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2528"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_55
#AT_START_56
at_fn_group_banner 56 'input.at:2543' \
"Bad escapes in literals" " " 2
at_xfail=no
(
printf "%s\n" "56. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
start: '\777' '\0' '\xfff' '\x0'
'\uffff' '\u0000' '\Uffffffff' '\U00000000'
'\ ' '\A';
_ATEOF
# It is not easy to create special characters, we cannot even trust tr.
# Beside we cannot even expect "echo '\0'" to output two characters
# (well three with \n): at least Bash 3.2 converts the two-character
# sequence "\0" into a single NUL character.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2556: \"\$PERL\" -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -e 'print \"start: \\\"\\\\\\t\\\\\\f\\\\\\0\\\\\\1\\\" ;\";' >> input.y || exit 77" "input.at:2556"
( $at_check_trace; "$PERL" -e 'print "start: \"\\\t\\\f\\\0\\\1\" ;";' >> input.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2556"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2558: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2558"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.9-12: error: invalid number after \\-escape: 777
input.y:2.16-17: error: invalid number after \\-escape: 0
input.y:2.21-25: error: invalid number after \\-escape: xfff
input.y:2.29-31: error: invalid number after \\-escape: x0
input.y:3.9-14: error: invalid number after \\-escape: uffff
input.y:3.18-23: error: invalid number after \\-escape: u0000
input.y:3.27-36: error: invalid number after \\-escape: Uffffffff
input.y:3.40-49: error: invalid number after \\-escape: U00000000
input.y:4.9-10: error: invalid character after \\-escape: ' '
input.y:4.14-15: error: invalid character after \\-escape: A
input.y:5.9-16: error: invalid character after \\-escape: \\t
input.y:5.17: error: invalid character after \\-escape: \\f
input.y:5.18: error: invalid character after \\-escape: \\0
input.y:5.19: error: invalid character after \\-escape: \\001
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2558"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_56
#AT_START_57
at_fn_group_banner 57 'input.at:2582' \
"Unexpected end of file" " " 2
at_xfail=no
(
printf "%s\n" "57. $at_setup_line: testing $at_desc ..."
$at_traceon
: >input.y
{ set +x
printf "%s\n" "$at_srcdir/input.at:2586: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:2586"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1: error: unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2586"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >char.y <<'_ATEOF'
%token FOO '
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2591:
set x \`LC_ALL=C ls -l 'char.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='char.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2591"
( $at_check_trace;
set x `LC_ALL=C ls -l 'char.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='char.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2591"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2594: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret char.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret char.y" "input.at:2594"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret char.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "char.y:1.12: error: missing \"'\" at end of file
1 | %token FOO '
| ^
char.y:1.12: error: empty character literal
1 | %token FOO '
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2594"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >escape-in-char.y <<'_ATEOF'
%token FOO '\
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2604:
set x \`LC_ALL=C ls -l 'escape-in-char.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='escape-in-char.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2604"
( $at_check_trace;
set x `LC_ALL=C ls -l 'escape-in-char.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='escape-in-char.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2604"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2607: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-char.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-char.y" "input.at:2607"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-char.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "escape-in-char.y:1.12-13: error: missing '?\\'' at end of file
1 | %token FOO '\\
| ^~
escape-in-char.y:1.14: error: unexpected end of file
1 | %token FOO '\\
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2607"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >string.y <<'_ATEOF'
%token FOO "
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2617:
set x \`LC_ALL=C ls -l 'string.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='string.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2617"
( $at_check_trace;
set x `LC_ALL=C ls -l 'string.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='string.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2617"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2620: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret string.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret string.y" "input.at:2620"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret string.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "string.y:1.12: error: missing '\"' at end of file
1 | %token FOO \"
| ^
string.y:1.13: error: unexpected end of file
1 | %token FOO \"
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2620"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >escape-in-string.y <<'_ATEOF'
%token FOO "\
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2630:
set x \`LC_ALL=C ls -l 'escape-in-string.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='escape-in-string.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2630"
( $at_check_trace;
set x `LC_ALL=C ls -l 'escape-in-string.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='escape-in-string.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2630"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2633: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-string.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-string.y" "input.at:2633"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-string.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "escape-in-string.y:1.12-13: error: missing '?\"' at end of file
1 | %token FOO \"\\
| ^~
escape-in-string.y:1.14: error: unexpected end of file
1 | %token FOO \"\\
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2633"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >tstring.y <<'_ATEOF'
%token FOO _("
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2643:
set x \`LC_ALL=C ls -l 'tstring.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='tstring.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2643"
( $at_check_trace;
set x `LC_ALL=C ls -l 'tstring.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='tstring.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2643"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2646: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret tstring.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret tstring.y" "input.at:2646"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret tstring.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "tstring.y:1.12-14: error: missing '\")' at end of file
1 | %token FOO _(\"
| ^~~
tstring.y:1.15: error: unexpected end of file
1 | %token FOO _(\"
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2646"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >escape-in-tstring.y <<'_ATEOF'
%token FOO _("\
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2656:
set x \`LC_ALL=C ls -l 'escape-in-tstring.y'\` &&
size=\$6 &&
{ test \$size -eq 0 || dd obs=1 seek=\`expr \$size - 1\` if=/dev/null of='escape-in-tstring.y'; } || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2656"
( $at_check_trace;
set x `LC_ALL=C ls -l 'escape-in-tstring.y'` &&
size=$6 &&
{ test $size -eq 0 || dd obs=1 seek=`expr $size - 1` if=/dev/null of='escape-in-tstring.y'; } || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2656"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2659: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-tstring.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-tstring.y" "input.at:2659"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret escape-in-tstring.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "escape-in-tstring.y:1.12-15: error: missing '?\")' at end of file
1 | %token FOO _(\"\\
| ^~~~
escape-in-tstring.y:1.16: error: unexpected end of file
1 | %token FOO _(\"\\
| ^
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2659"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_57
#AT_START_58
at_fn_group_banner 58 'input.at:2675' \
"LAC: Errors for %define" " " 2
at_xfail=no
(
printf "%s\n" "58. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
start: %empty;
_ATEOF
# Only "full" and "none" are accepted for parse.lac
# Unknown values (such as "unsupported") are rejected
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Syacc.c -Dparse.lac=none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Syacc.c -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=none input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=none input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=none input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Syacc.c -Dparse.lac=full input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Syacc.c -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=full input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Syacc.c -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=full input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=unsupported input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=unsupported input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Syacc.c -Dparse.lac=unsupported input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid value for %define variable 'parse.lac': 'unsupported'
<command line>:4: note: accepted value: 'full'
<command line>:4: note: accepted value: 'none'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.cc -Dparse.lac=none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.cc -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=none input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=none input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=none input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.cc -Dparse.lac=full input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.cc -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=full input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.cc -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=full input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=unsupported input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=unsupported input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=unsupported input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid value for %define variable 'parse.lac': 'unsupported'
<command line>:4: note: accepted value: 'full'
<command line>:4: note: accepted value: 'none'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.d -Dparse.lac=none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.d -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=none input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=none input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=none input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.d -Dparse.lac=full input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.d -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=full input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.d -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=full input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=unsupported input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=unsupported input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.d -Dparse.lac=unsupported input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid value for %define variable 'parse.lac': 'unsupported'
<command line>:4: note: accepted value: 'full'
<command line>:4: note: accepted value: 'none'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.java -Dparse.lac=none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.java -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=none input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=none input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=none input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Slalr1.java -Dparse.lac=full input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Slalr1.java -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=full input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Slalr1.java -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2685"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=full input.y"
at_fn_check_prepare_trace "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2685: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=unsupported input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=unsupported input.y" "input.at:2685"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=unsupported input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid value for %define variable 'parse.lac': 'unsupported'
<command line>:4: note: accepted value: 'full'
<command line>:4: note: accepted value: 'none'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2685"
$at_failed && at_fn_log_failure
$at_traceon; }
# parse.lac.* options are useless if LAC isn't actually activated.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2697: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y" "input.at:2697"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:3: error: %define variable 'parse.lac.es-capacity-initial' is not used
<command line>:4: error: %define variable 'parse.lac.memory-trace' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2697"
$at_failed && at_fn_log_failure
$at_traceon; }
# parse.lac.* options are useless in C++/Java even if LAC is actually activated.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2704: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y" "input.at:2704"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.cc -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:5: error: %define variable 'parse.lac.es-capacity-initial' is not used
<command line>:6: error: %define variable 'parse.lac.memory-trace' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2704"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2704: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y" "input.at:2704"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Slalr1.java -Dparse.lac=full -Dparse.lac.es-capacity-initial=1 -Dparse.lac.memory-trace=full input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:5: error: %define variable 'parse.lac.es-capacity-initial' is not used
<command line>:6: error: %define variable 'parse.lac.memory-trace' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2704"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_58
#AT_START_59
at_fn_group_banner 59 'input.at:2719' \
"-Werror combinations" " " 2
at_xfail=no
(
printf "%s\n" "59. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
a: '0' { $$ = $; };
_ATEOF
# -Werror is not enabled by -Wall or equivalent.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2727"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2727"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2727"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y"
at_fn_check_prepare_trace "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.15: warning: stray '$' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2727"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2727: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" "input.at:2727"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2727"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -W input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -W input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y" "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -W input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2730"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2730"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2730"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -W input.y"
at_fn_check_prepare_trace "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -W input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror" "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.15: warning: stray '$' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2730"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error" "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none" "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2730: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none" "input.at:2730"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -W input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2730"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-none input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y" "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2733"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2733"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2733"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-none input.y"
at_fn_check_prepare_trace "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-none input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror" "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.15: warning: stray '$' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2733"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error" "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none" "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2733: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none" "input.at:2733"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-none input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2733"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# -Werror is not disabled by -Wnone or equivalent.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2738: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y" "input.at:2738"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,none,other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: error: stray '\$' [-Werror=other]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2738"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2741: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y" "input.at:2741"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror,no-all,other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: error: stray '\$' [-Werror=other]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2741"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that -Wno-error keeps warnings enabled, but non fatal.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Werror -Wno-error=other input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2746"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Werror -Wno-error=other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y" "input.at:2746"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror -Wno-error=other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2746"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2746"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2746"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2746: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror -Wno-error=other input.y"
at_fn_check_prepare_trace "input.at:2746"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror -Wno-error=other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2746"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-error=other -Werror input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2750"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-error=other -Werror input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y" "input.at:2750"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-error=other -Werror input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2750"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2750"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2750"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2750: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-error=other -Werror input.y"
at_fn_check_prepare_trace "input.at:2750"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-error=other -Werror input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.15: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2750"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Werror=other -Wno-other input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2754"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Werror=other -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y" "input.at:2754"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror=other -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2754"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2754"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2754"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2754: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror=other -Wno-other input.y"
at_fn_check_prepare_trace "input.at:2754"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror=other -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2754"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_59
#AT_START_60
at_fn_group_banner 60 'input.at:2764' \
"%name-prefix and api.prefix are incompatible" " " 2
at_xfail=no
(
printf "%s\n" "60. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION)
# --------------------------------------------
cat >input.y <<'_ATEOF'
%define api.prefix {foo} %name-prefix "bar"
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2779: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated input.y" "input.at:2779"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-deprecated input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-24: error: '%name-prefix' and '%define api.prefix' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2779"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2780: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y" "input.at:2780"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -p bar -Wno-deprecated input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:3: error: '%name-prefix' and '%define api.prefix' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2780"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%name-prefix "bar"
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2781: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y" "input.at:2781"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dapi.prefix={foo} -Wno-deprecated input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:3: error: '%name-prefix' and '%define api.prefix' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2781"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.prefix {foo}
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2782: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated input.y" "input.at:2782"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -p bar -Wno-deprecated input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-24: error: '%name-prefix' and '%define api.prefix' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2782"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_60
#AT_START_61
at_fn_group_banner 61 'input.at:2793' \
"Redefined %union name" " " 2
at_xfail=no
(
printf "%s\n" "61. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST(DIRECTIVES, EXIT-STATUS, ERROR)
# ---------------------------------------
cat >input.y <<'_ATEOF'
%union foo {};
%union {};
%union foo {};
%define api.value.union.name foo
%%
exp: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2808"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2808"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2808"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:3.8-10: warning: %define variable 'api.value.union.name' redefined [-Wother]
input.y:1.8-10: note: previous definition
input.y:4.1-32: warning: %define variable 'api.value.union.name' redefined [-Wother]
input.y:3.8-10: note: previous definition
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:3.8-10: warning: %define variable 'api.value.union.name' redefined [-Wother]
input.y:1.8-10: note: previous definition
input.y:4.1-32: warning: %define variable 'api.value.union.name' redefined [-Wother]
input.y:3.8-10: note: previous definition
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2808"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2808: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:2808"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2808"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >input.y <<'_ATEOF'
%define api.value.union.name {foo}
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2820: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2820"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2820"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define api.value.union.name "foo"
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:2825: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:2825"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-34: error: %define variable 'api.value.union.name' requires keyword values
input.y:1.1-34: error: %define variable 'api.value.union.name' is not used
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2825"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_61
#AT_START_62
at_fn_group_banner 62 'input.at:2840' \
"Stray \$ or @" " " 2
at_xfail=no
(
printf "%s\n" "62. $at_setup_line: testing $at_desc ..."
$at_traceon
# Give %printer and %destructor "<*> exp TOK" instead of "<*>" to
# check that the warnings are reported once, not three times.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%type <TYPE> exp
%token <TYPE> TOK TOK2
%destructor { $%; @%; } <*> exp TOK;
%initial-action { $%; @%; };
%printer { $%; @%; } <*> exp TOK;
%{ $ @ %} // Should not warn.
%%
exp: TOK { $%; @%; $$ = $1; }
| 'a' { $<->1; $$ = 1; }
| 'b' { $<foo->bar>$; }
%%
$ @ // Should not warn.
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2861"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2861"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2861"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y"
at_fn_check_prepare_trace "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:11.19: warning: stray '\$' [-Wother]
input.y:11.23: warning: stray '@' [-Wother]
input.y:12.19: warning: stray '\$' [-Wother]
input.y:12.23: warning: stray '@' [-Wother]
input.y:13.19: warning: stray '\$' [-Wother]
input.y:13.23: warning: stray '@' [-Wother]
input.y:16.19: warning: stray '\$' [-Wother]
input.y:16.23: warning: stray '@' [-Wother]
input.y:17.19: warning: stray '\$' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror" "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:11.19: warning: stray '$' [-Wother]
input.y:11.23: warning: stray '@' [-Wother]
input.y:12.19: warning: stray '$' [-Wother]
input.y:12.23: warning: stray '@' [-Wother]
input.y:13.19: warning: stray '$' [-Wother]
input.y:13.23: warning: stray '@' [-Wother]
input.y:16.19: warning: stray '$' [-Wother]
input.y:16.23: warning: stray '@' [-Wother]
input.y:17.19: warning: stray '$' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:2861"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error" "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none" "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2861: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none" "input.at:2861"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2861"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_62
#AT_START_63
at_fn_group_banner 63 'input.at:2883' \
"Code injection" " " 2
at_xfail=no
(
printf "%s\n" "63. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST([MACRO])
# ----------------
# Try to have MACRO be run by bison.
cat >input.y <<'_ATEOF'
%type <b4_canary(%type)> exp
%token <b4_canary(%token)> a
%token b
%initial-action
{
$$;
$<b4_canary(%initial-action)>$
};
%printer
{
$$
$<b4_canary(%printer)>$
} <> <*>;
%lex-param
{
b4_canary(%lex-param)
};
%parse-param
{
b4_canary(%parse-param)
};
%%
exp:
a a[name] b
{
$$;
$1;
$<b4_canary(action 1)>$
$<b4_canary(action 2)>1
$<b4_canary(action 3)>name
$<b4_canary(action 4)>0
;
};
_ATEOF
# Disable -Wother to avoid the warnings about the suspicious presence
# of `b4_canary` in the output.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y" "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2934"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2934: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_trace "input.at:2934"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2934"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%type <]b4_canary(%type)> exp
%token <]b4_canary(%token)> a
%token b
%initial-action
{
$$;
$<]b4_canary(%initial-action)>$
};
%printer
{
$$
$<]b4_canary(%printer)>$
} <> <*>;
%lex-param
{
]b4_canary(%lex-param)
};
%parse-param
{
]b4_canary(%parse-param)
};
%%
exp:
a a[name] b
{
$$;
$1;
$<]b4_canary(action 1)>$
$<]b4_canary(action 2)>1
$<]b4_canary(action 3)>name
$<]b4_canary(action 4)>0
;
};
_ATEOF
# Disable -Wother to avoid the warnings about the suspicious presence
# of `b4_canary` in the output.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S yacc.c -d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S yacc.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.c -d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.cc -d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.cc -d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr2.cc -d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S glr2.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.d input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y" "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:2935"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:2935: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.java input.y"
at_fn_check_prepare_trace "input.at:2935"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-other -S lalr1.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:2935"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_63
#AT_START_64
at_fn_group_banner 64 'input.at:2946' \
"Deprecated directives" " " 2
at_xfail=no
(
printf "%s\n" "64. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%default_prec
%error_verbose
%expect_rr 0
%file-prefix = "foo"
%file-prefix
=
"bar"
%fixed-output_files
%fixed_output-files
%fixed-output-files
%name-prefix= "foo"
%no-default_prec
%no_default-prec
%no_lines
%output = "output.c"
%pure_parser
%token_table
%error-verbose
%glr-parser
%name-prefix "bar"
%defines "header.h"
%%
exp : '0'
_ATEOF
cat >errors-all <<'_ATEOF'
input.y:10.1-13: warning: deprecated directive: '%default_prec', use '%default-prec' [-Wdeprecated]
fix-it:"input.y":{10:1-10:14}:"%default-prec"
input.y:11.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
fix-it:"input.y":{11:1-11:15}:"%define parse.error verbose"
input.y:12.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
fix-it:"input.y":{12:1-12:11}:"%expect-rr"
input.y:13.1-14: warning: deprecated directive: '%file-prefix =', use '%file-prefix' [-Wdeprecated]
fix-it:"input.y":{13:1-13:15}:"%file-prefix"
input.y:14.1-16.5: warning: duplicate directive: '%file-prefix\n =' [-Wother]
input.y:13.1-20: note: previous declaration
fix-it:"input.y":{14:1-16:6}:""
input.y:17.9-27: warning: deprecated directive: '%fixed-output_files', use '%output "y.tab.c"' [-Wdeprecated]
fix-it:"input.y":{17:2-17:21}:"%output \"y.tab.c\""
input.y:18.9-27: warning: deprecated directive: '%fixed_output-files', use '%output "y.tab.c"' [-Wdeprecated]
fix-it:"input.y":{18:9-18:28}:"%output \"y.tab.c\""
input.y:19.1-19: warning: deprecated directive: '%fixed-output-files', use '%output "y.tab.c"' [-Wdeprecated]
fix-it:"input.y":{19:1-19:20}:"%output \"y.tab.c\""
input.y:20.1-19: warning: deprecated directive: '%name-prefix= "foo"', use '%define api.prefix {foo}' [-Wdeprecated]
fix-it:"input.y":{20:1-20:20}:"%define api.prefix {foo}"
input.y:21.1-16: warning: deprecated directive: '%no-default_prec', use '%no-default-prec' [-Wdeprecated]
fix-it:"input.y":{21:1-21:17}:"%no-default-prec"
input.y:22.1-16: warning: deprecated directive: '%no_default-prec', use '%no-default-prec' [-Wdeprecated]
fix-it:"input.y":{22:1-22:17}:"%no-default-prec"
input.y:23.1-9: warning: deprecated directive: '%no_lines', use '%no-lines' [-Wdeprecated]
fix-it:"input.y":{23:1-23:10}:"%no-lines"
input.y:24.1-9: warning: deprecated directive: '%output =', use '%output' [-Wdeprecated]
fix-it:"input.y":{24:1-24:10}:"%output"
input.y:25.1-12: warning: deprecated directive: '%pure_parser', use '%define api.pure' [-Wdeprecated]
fix-it:"input.y":{25:1-25:13}:"%define api.pure"
input.y:26.1-12: warning: deprecated directive: '%token_table', use '%token-table' [-Wdeprecated]
fix-it:"input.y":{26:1-26:13}:"%token-table"
input.y:27.1-14: warning: %define variable 'parse.error' redefined [-Wother]
input.y:11.1-14: note: previous definition
fix-it:"input.y":{27:1-27:15}:""
input.y:29.1-18: warning: duplicate directive: '%name-prefix "bar"' [-Wother]
input.y:13.1-20: note: previous declaration
fix-it:"input.y":{29:1-29:19}:""
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3019: cp errors-all experr"
at_fn_check_prepare_trace "input.at:3019"
( $at_check_trace; cp errors-all experr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3019"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -ffixit input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3020"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -ffixit input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y" "input.at:3020"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -ffixit input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3020"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3020"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3020"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3020: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -ffixit input.y"
at_fn_check_prepare_trace "input.at:3020"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -ffixit input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3020"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3022: sed -e '/^fix-it:/d' errors-all >experr"
at_fn_check_prepare_trace "input.at:3022"
( $at_check_trace; sed -e '/^fix-it:/d' errors-all >experr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3022"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3023"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:3023"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3023"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3023"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3023"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3023: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:3023"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3023"
$at_failed && at_fn_log_failure
$at_traceon; }
# Update the input file. Make sure we generated nothing.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3027: rm -f output.c"
at_fn_check_prepare_trace "input.at:3027"
( $at_check_trace; rm -f output.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3028: cp input.y input.y.orig"
at_fn_check_prepare_trace "input.at:3028"
( $at_check_trace; cp input.y input.y.orig
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3028"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3029: sed -e '/fix-it/d' <errors-all >experr"
at_fn_check_prepare_trace "input.at:3029"
( $at_check_trace; sed -e '/fix-it/d' <errors-all >experr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3029"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3030: echo \"bison: file 'input.y' was updated (backup: 'input.y~')\" >>experr"
at_fn_check_prepare_trace "input.at:3030"
( $at_check_trace; echo "bison: file 'input.y' was updated (backup: 'input.y~')" >>experr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3030"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --update input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3031"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --update input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y" "input.at:3031"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3031"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3031"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3031"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3031: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --update input.y"
at_fn_check_prepare_trace "input.at:3031"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --update input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3031"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the backup.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3034: diff input.y.orig input.y~"
at_fn_check_prepare_trace "input.at:3034"
( $at_check_trace; diff input.y.orig input.y~
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3034"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check we did not generate any file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3037: test ! -f output.c"
at_fn_check_prepare_trace "input.at:3037"
( $at_check_trace; test ! -f output.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3037"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the update.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3040: sed -e '1,8d' input.y"
at_fn_check_prepare_trace "input.at:3040"
( $at_check_trace; sed -e '1,8d' input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
%default-prec
%define parse.error verbose
%expect-rr 0
%file-prefix \"foo\"
%output \"y.tab.c\"
%output \"y.tab.c\"
%output \"y.tab.c\"
%define api.prefix {foo}
%no-default-prec
%no-default-prec
%no-lines
%output \"output.c\"
%define api.pure
%token-table
%glr-parser
%defines \"header.h\"
%%
exp : '0'
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3040"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:3062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3062"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3062"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3062"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3062: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:3062"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3062"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_64
#AT_START_65
at_fn_group_banner 65 'input.at:3077' \
"Unput's effect on locations" " " 2
at_xfail=no
(
printf "%s\n" "65. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%expect_rr 42 %expect_rr 42
%expect_rr 42
%error_verbose %error_verbose
%error_verbose
%% exp: '0'
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3092: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:3092"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:11.1-10: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
input.y:11.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
input.y:12.15-24: warning: deprecated directive: '%expect_rr', use '%expect-rr' [-Wdeprecated]
input.y:13.1-14: warning: deprecated directive: '%error_verbose', use '%define parse.error verbose' [-Wdeprecated]
input.y:13.16-29: warning: %define variable 'parse.error' redefined [-Wother]
input.y:13.1-14: note: previous definition
input.y:14.16-29: warning: %define variable 'parse.error' redefined [-Wother]
input.y:13.16-29: note: previous definition
input.y: error: reduce/reduce conflicts: 0 found, 42 expected
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3092"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_65
#AT_START_66
at_fn_group_banner 66 'input.at:3113' \
"Non-deprecated directives" " " 2
at_xfail=no
(
printf "%s\n" "66. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%default-prec
%define parse.error verbose
%expect-rr 42
%file-prefix "foo"
%file-prefix
"bar"
%no-default-prec
%no-lines
%output "foo"
%token-table
%% exp : '0'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3133"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3133"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3133"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother]
input.y:13.1-18: note: previous declaration
input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:14.1-15.5: warning: duplicate directive: '%file-prefix' [-Wother]
input.y:13.1-18: note: previous declaration
input.y: warning: %expect-rr applies only to GLR parsers [-Wother]
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:3133"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "input.at:3133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3133"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_66
#AT_START_67
at_fn_group_banner 67 'input.at:3148' \
"Cannot type action" " " 2
at_xfail=no
(
printf "%s\n" "67. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: <int> {}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3156"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "input.at:3156"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "input.at:3156"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother]
10 | exp: <int> {}
| ^~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:10.6-13: warning: only midrule actions can be typed: int [-Wother]
10 | exp: <int> {}
| ^~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "input.at:3156"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/input.at:3156: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "input.at:3156"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/input.at:3156"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_67
#AT_START_68
at_fn_group_banner 68 'input.at:3171' \
"Character literals and api.token.raw" " " 2
at_xfail=no
(
printf "%s\n" "68. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.token.raw
%token 'a'
%%
exp: 'b' "c" {}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3181: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y" "input.at:3181"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:10.8-10: error: character literals cannot be used together with api.token.raw
10 | %token 'a'
| ^~~
input.y:9.1-21: note: definition of api.token.raw
9 | %define api.token.raw
| ^~~~~~~~~~~~~~~~~~~~~
input.y:12.6-8: error: character literals cannot be used together with api.token.raw
12 | exp: 'b' \"c\" {}
| ^~~
input.y:9.1-21: note: definition of api.token.raw
9 | %define api.token.raw
| ^~~~~~~~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3181"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_68
#AT_START_69
at_fn_group_banner 69 'input.at:3205' \
"%token-table and parse.error" " " 2
at_xfail=no
(
printf "%s\n" "69. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST(DIRECTIVES, ERROR-LOCATION)
# -----------------------------------
cat >input.y <<'_ATEOF'
%define parse.error custom %token-table
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:3220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-26: error: '%token-table' and '%define parse.error (custom|detailed)' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3220"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%define parse.error detailed %token-table
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3221: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "input.at:3221"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:1.1-28: error: '%token-table' and '%define parse.error (custom|detailed)' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3221"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_69
#AT_START_70
at_fn_group_banner 70 'input.at:3231' \
"Invalid file prefix mapping arguments" " " 2
at_xfail=no
(
printf "%s\n" "70. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST(DIRECTIVES, OPTIONS, ERROR-LOCATION)
# --------------------------------------------
cat >input.y <<'_ATEOF'
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3246: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo input.y" "input.at:3246"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid argument for '--file-prefix-map': foo
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3246"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3247: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --file-prefix-map foo input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --file-prefix-map foo input.y" "input.at:3247"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --file-prefix-map foo input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:4: error: invalid argument for '--file-prefix-map': foo
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3247"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo=bar -M baz input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo=bar -M baz input.y" "input.at:3248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo=bar -M baz input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:6: error: invalid argument for '--file-prefix-map': baz
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3248"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/input.at:3249: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo= -M baz input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo= -M baz input.y" "input.at:3249"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -M foo= -M baz input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<command line>:6: error: invalid argument for '--file-prefix-map': baz
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/input.at:3249"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_70
#AT_START_71
at_fn_group_banner 71 'named-refs.at:22' \
"Tutorial calculator" " " 3
at_xfail=no
(
printf "%s\n" "71. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
typedef int semantic_value;
FILE *input;
static semantic_value global_result = 0;
static int global_count = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
%}
%union
{
semantic_value ival;
};
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
%%
input:
line
| input line {}
;
line:
'\n'
| exp '\n' {}
;
exp:
NUM { $$ = $NUM; }
| exp[l] '=' exp[r]
{
if ($l != $r)
fprintf (stderr, "calc: error: %d != %d\n", $l, $r);
$$ = $l;
}
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>l + $r; }
| exp[l] '-' exp[r] { $$ = $l - $r; }
| exp[l] '*' exp[r] { $$ = $l * $r; }
| exp[l] '/' exp[r] { $$ = $l / $r; }
| '-' exp %prec NEG { $$ = -$2; }
| exp[l] '^' exp[r] { $$ = power ($l, $r); }
| '(' exp[e] ')' { $$ = $e; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '!' { $$ = 0; YYERROR; }
| '-' error { $$ = 0; YYERROR; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int get_char (void)
{
return getc (input);
}
static void unget_char (int c)
{
ungetc (c, input);
}
static int read_signed_integer (void)
{
int c = get_char ();
int sign = 1;
int n = 0;
if (c == '-')
{
c = get_char ();
sign = -1;
}
while (isdigit (c))
{
n = 10 * n + (c - '0');
c = get_char ();
}
unget_char ( c);
return sign * n;
}
static int
yylex (void)
{
int c;
/* Skip white space. */
while ((c = get_char ()) == ' ' || c == '\t') {}
/* process numbers */
if (c == '.' || isdigit (c))
{
unget_char ( c);
(yylval).ival = read_signed_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* Return single chars. */
return c;
}
static int power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
int main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int status;
if (argc == 2)
input = fopen (argv[1], "r");
else
input = stdin;
if (!input)
{
perror (argv[1]);
return 3;
}
status = yyparse ();
fclose (input);
assert (global_result == result); (void) global_result; (void) result;
assert (global_count == count); (void) global_count; (void) count;
return status;
}
_ATEOF
cat >input.txt <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "named-refs.at:184"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:184"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "named-refs.at:184" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/named-refs.at:184"
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:184: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "named-refs.at:184"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:185: \$PREPARSER ./test input.txt"
at_fn_check_prepare_dynamic " $PREPARSER ./test input.txt" "named-refs.at:185"
( $at_check_trace; $PREPARSER ./test input.txt
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:185: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "named-refs.at:185"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_71
#AT_START_72
at_fn_group_banner 72 'named-refs.at:196' \
"Undefined and ambiguous references" " " 3
at_xfail=no
(
printf "%s\n" "72. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
%}
%union
{
int ival;
};
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
%%
input:
line
| input line {}
;
line:
'\n'
| exp '\n' {}
;
exp:
NUM { $$ = $NUM; }
| exp[l] '=' exp[r]
{
if ($l != $r)
fprintf (stderr, "calc: error: %d != %d\n", $l, $r);
$$ = $l;
}
| exp[x] '+' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>lo9 + $r; }
| exp[x] '-' { $<ival>$ = $x; } [l] exp[r] { $$ = $<ival>exp - $r; }
| exp[x] '*' { $<ival>$ = $x; } [l] exp[r] { $$ = $l * $r; }
| exp[l] '/' exp[r] { $$ = $l / $r; }
| '-' exp %prec NEG { $$ = -$2; }
| exp[l] '^' exp[r] { $$ = power ($l, $r12); }
| '(' exp ')' { $$ = $expo; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '!' { $$ = 0; YYERROR; }
| '-' error { $$ = 0; YYERROR; }
;
%%
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:254: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" "named-refs.at:254"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:52.51-60: error: invalid reference: '\$<ival>lo9'
52 | | exp[x] '+' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>lo9 + \$r; }
| ^~~~~~~~~~
test.y:52.3-68: note: symbol not found in production: lo9
52 | | exp[x] '+' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>lo9 + \$r; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:53.51-60: warning: misleading reference: '\$<ival>exp' [-Wother]
53 | | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
| ^~~~~~~~~~
test.y:44.1-3: note: refers to: \$exp at \$\$
44 | exp:
| ^~~
test.y:53.7: note: possibly meant: \$x, hiding \$exp at \$1
53 | | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
| ^
test.y:53.41: note: possibly meant: \$r, hiding \$exp at \$4
53 | | exp[x] '-' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$<ival>exp - \$r; }
| ^
test.y:54.51-52: error: \$l of 'exp' has no declared type
54 | | exp[x] '*' { \$<ival>\$ = \$x; } [l] exp[r] { \$\$ = \$l * \$r; }
| ^~
test.y:57.40-43: error: invalid reference: '\$r12'
57 | | exp[l] '^' exp[r] { \$\$ = power (\$l, \$r12); }
| ^~~~
test.y:57.3-47: note: symbol not found in production: r12
57 | | exp[l] '^' exp[r] { \$\$ = power (\$l, \$r12); }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:58.29-33: error: invalid reference: '\$expo'
58 | | '(' exp ')' { \$\$ = \$expo; }
| ^~~~~
test.y:58.3-46: note: symbol not found in production: expo
58 | | '(' exp ')' { \$\$ = \$expo; }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_72
#AT_START_73
at_fn_group_banner 73 'named-refs.at:297' \
"Misleading references" " " 3
at_xfail=no
(
printf "%s\n" "73. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start: foo foo.bar { $foo.bar; }
foo: '1'
foo.bar: '2'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:306"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "named-refs.at:306"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:306"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.22-29: warning: misleading reference: '\$foo.bar' [-Wother]
test.y:11.8-10: note: refers to: \$foo at \$1
test.y:11.12-18: note: possibly meant: \$[foo.bar] at \$2
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror" "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
test.y:11.22-29: warning: misleading reference: '$foo.bar' [-Wother]
test.y:11.8-10: note: refers to: $foo at $1
test.y:11.12-18: note: possibly meant: $[foo.bar] at $2
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:306"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error" "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none" "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:306: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none" "named-refs.at:306"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:306"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_73
#AT_START_74
at_fn_group_banner 74 'named-refs.at:316' \
"Many kinds of errors" " " 3
at_xfail=no
(
printf "%s\n" "74. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token IDENT
%token NUMBER
%token ASSIGNOP
%token IF
%token IF1
%token THEN
%token ELSE
%token FI
%token WHILE
%token DO
%token OD
%start program
%%
if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
{ $if_stmt1 = new IfStmt($cond1, $then.f1, $else); };
if_stmt2: IF expr[cond] THEN stmt[then] FI
{ $if_stmt2 = new IfStmt($cond, $stmt.field, 0); };
if_stmt3: IF expr[cond] THEN stmt.list FI
{ $if_stmt3 = new IfStmt($cond, $stmt.list, 0); };
if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
{ $if_stmt4 = new IfStmt($cond, $xyz, $cond); };
if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
{ $if_stmt5 = new IfStmt($cond, $stmt.list, $else); };
if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
{ $if_stmt6 = new IfStmt($cond, $stmt.list.field, $else); };
if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
{ $if_stmt7 = new IfStmt($cond, $[stmt.list].field, $else); };
if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
{ $if_stmt8 = new IfStmt($cond, $then.1, $else); };
if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
{ $if_stmt9 = new IfStmt($cond, $then.1.field, $else); };
if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
{ $if_stmt10 = new IfStmt($cond, $stmt.x, 0); };
if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
{ $if-stmt-a = new IfStmt($cond, $then, $else); };
if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
{ $[if-stmt-b] = new IfStmt($cond, $then-a.f, $else); };
program: stmt.list;
stmt.list: stmt ';' stmt.list { $3->insert($stmt); $$ = $3; }
| stmt ';' { SL = new StmtList(); SL->insert($1); $$ = SL; }
;
stmt: assign_stmt { $$ = $1; }
| if_stmt { $$ = $1; }
| if_stmt1 { $$ = $1; }
| while_stmt { $$ = $1; }
;
assign_stmt: IDENT ASSIGNOP expr
{ $$ = new AssignStmt(string($1),$3); };
if_stmt: IF expr[cond] THEN stmt.list FI
{ $if_stmt = new IfStmt($cond, $[stmt.list], 0); };
while_stmt[res]: WHILE expr DO stmt.list OD
{ $res = new WhileStmt($[expr], $[stmt.list]); };
expr: expr '+' term { $$ = new Plus($1,$3); }
| expr '-' term { $$ = new Minus($1,$3); }
| term { $$ = $1; }
;
term: term '*' factor { $$ = new Times($1,$3); }
| factor { $$ = $1; }
;
factor: '(' expr ')' { $$ = $2; }
| NUMBER { $$ = new Number($1); }
| IDENT { $$ = new Ident(string($1)); }
;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:384: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:384"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:24.36-41: error: invalid reference: '\$cond1'
test.y:23.11-24.62: note: symbol not found in production: cond1
test.y:26.43-53: error: invalid reference: '\$stmt.field'
test.y:25.11-26.60: note: symbol not found in production: stmt
test.y:25.35-38: note: possibly meant: \$then.field, hiding \$stmt.field at \$4
test.y:28.43-52: error: invalid reference: '\$stmt.list'
test.y:27.11-28.59: note: symbol not found in production: stmt
test.y:27.30-38: note: possibly meant: \$[stmt.list] at \$4
test.y:30.43-46: error: ambiguous reference: '\$xyz'
test.y:29.35-37: note: refers to: \$xyz at \$4
test.y:29.50-52: note: refers to: \$xyz at \$6
test.y:32.43-52: error: invalid reference: '\$stmt.list'
test.y:31.11-32.63: note: symbol not found in production: stmt
test.y:31.40-43: note: possibly meant: \$then, hiding \$[stmt.list] at \$4
test.y:31.61-64: note: possibly meant: \$else, hiding \$[stmt.list] at \$6
test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
test.y:33.11-34.69: note: symbol not found in production: stmt
test.y:33.40-43: note: possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
test.y:33.61-64: note: possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
test.y:35.11-36.71: note: symbol not found in production: stmt.list
test.y:35.40-43: note: possibly meant: \$then, hiding \$[stmt.list] at \$4
test.y:35.61-64: note: possibly meant: \$else, hiding \$[stmt.list] at \$6
test.y:38.43-49: error: invalid reference: '\$then.1'
test.y:37.11-38.60: note: symbol not found in production: then
test.y:37.40-45: note: possibly meant: \$[then.1] at \$4
test.y:40.43-55: error: invalid reference: '\$then.1.field'
test.y:39.11-40.66: note: symbol not found in production: then
test.y:39.40-45: note: possibly meant: \$[then.1].field at \$4
test.y:42.44-50: error: invalid reference: '\$stmt.x'
test.y:41.12-42.57: note: symbol not found in production: stmt
test.y:41.36-41: note: possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
test.y:41.36-41: note: possibly meant: \$[stmt.x] at \$4
test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
test.y:43.12-44.59: note: symbol not found in production: if
test.y:43.1-9: note: possibly meant: \$[if-stmt-a] at \$\$
test.y:46.46-54: error: invalid reference: '\$then-a.f'
test.y:45.12-46.65: note: symbol not found in production: then
test.y:45.41-46: note: possibly meant: \$[then-a].f at \$4
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:384"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:426: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y" "named-refs.at:426"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:24.36-41: error: invalid reference: '\$cond1'
24 | { \$if_stmt1 = new IfStmt(\$cond1, \$then.f1, \$else); };
| ^~~~~~
test.y:23.11-24.62: note: symbol not found in production: cond1
23 | if_stmt1: IF expr[cond] THEN stmt[then] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:26.43-53: error: invalid reference: '\$stmt.field'
26 | { \$if_stmt2 = new IfStmt(\$cond, \$stmt.field, 0); };
| ^~~~~~~~~~~
test.y:25.11-26.60: note: symbol not found in production: stmt
25 | if_stmt2: IF expr[cond] THEN stmt[then] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:25.35-38: note: possibly meant: \$then.field, hiding \$stmt.field at \$4
25 | if_stmt2: IF expr[cond] THEN stmt[then] FI
| ^~~~
test.y:28.43-52: error: invalid reference: '\$stmt.list'
28 | { \$if_stmt3 = new IfStmt(\$cond, \$stmt.list, 0); };
| ^~~~~~~~~~
test.y:27.11-28.59: note: symbol not found in production: stmt
27 | if_stmt3: IF expr[cond] THEN stmt.list FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:27.30-38: note: possibly meant: \$[stmt.list] at \$4
27 | if_stmt3: IF expr[cond] THEN stmt.list FI
| ^~~~~~~~~
test.y:30.43-46: error: ambiguous reference: '\$xyz'
30 | { \$if_stmt4 = new IfStmt(\$cond, \$xyz, \$cond); };
| ^~~~
test.y:29.35-37: note: refers to: \$xyz at \$4
29 | if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
| ^~~
test.y:29.50-52: note: refers to: \$xyz at \$6
29 | if_stmt4: IF expr[cond] THEN stmt[xyz] ELSE stmt[xyz] FI
| ^~~
test.y:32.43-52: error: invalid reference: '\$stmt.list'
32 | { \$if_stmt5 = new IfStmt(\$cond, \$stmt.list, \$else); };
| ^~~~~~~~~~
test.y:31.11-32.63: note: symbol not found in production: stmt
31 | if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:31.40-43: note: possibly meant: \$then, hiding \$[stmt.list] at \$4
31 | if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:31.61-64: note: possibly meant: \$else, hiding \$[stmt.list] at \$6
31 | if_stmt5: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:34.43-58: error: invalid reference: '\$stmt.list.field'
34 | { \$if_stmt6 = new IfStmt(\$cond, \$stmt.list.field, \$else); };
| ^~~~~~~~~~~~~~~~
test.y:33.11-34.69: note: symbol not found in production: stmt
33 | if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:33.40-43: note: possibly meant: \$then.field, hiding \$[stmt.list].field at \$4
33 | if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:33.61-64: note: possibly meant: \$else.field, hiding \$[stmt.list].field at \$6
33 | if_stmt6: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:36.43-54: error: invalid reference: '\$[stmt.list]'
36 | { \$if_stmt7 = new IfStmt(\$cond, \$[stmt.list].field, \$else); };
| ^~~~~~~~~~~~
test.y:35.11-36.71: note: symbol not found in production: stmt.list
35 | if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:35.40-43: note: possibly meant: \$then, hiding \$[stmt.list] at \$4
35 | if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:35.61-64: note: possibly meant: \$else, hiding \$[stmt.list] at \$6
35 | if_stmt7: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~
test.y:38.43-49: error: invalid reference: '\$then.1'
38 | { \$if_stmt8 = new IfStmt(\$cond, \$then.1, \$else); };
| ^~~~~~~
test.y:37.11-38.60: note: symbol not found in production: then
37 | if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:37.40-45: note: possibly meant: \$[then.1] at \$4
37 | if_stmt8: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
| ^~~~~~
test.y:40.43-55: error: invalid reference: '\$then.1.field'
40 | { \$if_stmt9 = new IfStmt(\$cond, \$then.1.field, \$else); };
| ^~~~~~~~~~~~~
test.y:39.11-40.66: note: symbol not found in production: then
39 | if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:39.40-45: note: possibly meant: \$[then.1].field at \$4
39 | if_stmt9: IF expr[cond] THEN stmt.list[then.1] ELSE stmt.list[else] FI
| ^~~~~~
test.y:42.44-50: error: invalid reference: '\$stmt.x'
42 | { \$if_stmt10 = new IfStmt(\$cond, \$stmt.x, 0); };
| ^~~~~~~
test.y:41.12-42.57: note: symbol not found in production: stmt
41 | if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:41.36-41: note: possibly meant: \$[stmt.x].x, hiding \$stmt.x at \$4
41 | if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
| ^~~~~~
test.y:41.36-41: note: possibly meant: \$[stmt.x] at \$4
41 | if_stmt10: IF expr[cond] THEN stmt[stmt.x] FI
| ^~~~~~
test.y:44.13-22: error: invalid reference: '\$if-stmt-a'
44 | { \$if-stmt-a = new IfStmt(\$cond, \$then, \$else); };
| ^~~~~~~~~~
test.y:43.12-44.59: note: symbol not found in production: if
43 | if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:43.1-9: note: possibly meant: \$[if-stmt-a] at \$\$
43 | if-stmt-a: IF expr[cond] THEN stmt.list[then] ELSE stmt.list[else] FI
| ^~~~~~~~~
test.y:46.46-54: error: invalid reference: '\$then-a.f'
46 | { \$[if-stmt-b] = new IfStmt(\$cond, \$then-a.f, \$else); };
| ^~~~~~~~~
test.y:45.12-46.65: note: symbol not found in production: then
45 | if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.y:45.41-46: note: possibly meant: \$[then-a].f at \$4
45 | if-stmt-b: IF expr[cond] THEN if-stmt-a[then-a] ELSE stmt.list[else] FI
| ^~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:426"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_74
#AT_START_75
at_fn_group_banner 75 'named-refs.at:551' \
"Missing identifiers in brackets" " " 3
at_xfail=no
(
printf "%s\n" "75. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start: foo[] bar
{ s = $foo; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:559: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:559"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.12: error: an identifier expected
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:559"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_75
#AT_START_76
at_fn_group_banner 76 'named-refs.at:567' \
"Redundant words in brackets" " " 3
at_xfail=no
(
printf "%s\n" "76. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start: foo[ a d ] bar
{ s = $foo; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:575: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:575"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.15: error: unexpected identifier in bracketed name: 'd'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:575"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_76
#AT_START_77
at_fn_group_banner 77 'named-refs.at:583' \
"Comments in brackets" " " 3
at_xfail=no
(
printf "%s\n" "77. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start: foo[/* comment */] bar
{ s = $foo; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:591: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:591"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.25: error: an identifier expected
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:591"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_77
#AT_START_78
at_fn_group_banner 78 'named-refs.at:599' \
"Stray symbols in brackets" " " 3
at_xfail=no
(
printf "%s\n" "78. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start: foo[ % /* aaa */ *&-.+\000\001\002\377 ] bar
{ s = $foo; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:607: \"\$PERL\" -pi -e 's/\\\\(\\d{3})/chr(oct(\$1))/ge' test.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's/\\\\(\\d{3})/chr(oct($1))/ge' test.y || exit 77" "named-refs.at:607"
( $at_check_trace; "$PERL" -pi -e 's/\\(\d{3})/chr(oct($1))/ge' test.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:607"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:608: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:608"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.13: error: invalid character in bracketed name: '%'
test.y:11.25-27: error: invalid characters in bracketed name: '*&-'
test.y:11.29-30: error: invalid characters in bracketed name: '+\\0\\001\\002\\377'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:608"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_78
#AT_START_79
at_fn_group_banner 79 'named-refs.at:618' \
"Redundant words in LHS brackets" " " 3
at_xfail=no
(
printf "%s\n" "79. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start[a s]: foo;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:625: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:625"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:11.9: error: unexpected identifier in bracketed name: 's'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:625"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_79
#AT_START_80
at_fn_group_banner 80 'named-refs.at:635' \
"Factored LHS" " " 3
at_xfail=no
(
printf "%s\n" "80. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
start[a]: "foo" | "bar";
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "named-refs.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:642"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "named-refs.at:642"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:642"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "named-refs.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_80
#AT_START_81
at_fn_group_banner 81 'named-refs.at:648' \
"Unresolved references" " " 3
at_xfail=no
(
printf "%s\n" "81. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
stat:
sym_a sym_b { func($sym.field); }
| sym_a sym_b { func($<aa>sym.field); }
| sym_a sym_b { func($[sym.field]); }
| sym_a sym_b { func($<aa>[sym.field]); }
| sym_a sym_b { func($sym); }
| sym_a sym_b { func($<aa>sym); }
| sym_a sym_b { func($[sym]); } sym_a sym_b { func($<aa>[sym]); }
;
stat1:
sym_a sym_b { func($sym-field); }
| sym_a sym_b { func($<aa>sym-field); }
| sym_a sym_b { func($[sym-field]); }
| sym_a sym_b { func($<aa>[sym-field]); }
| sym_a sym_b { func($sym); }
| sym_a sym_b { func($<aa>sym); }
| sym_a sym_b { func($[sym]); } sym_a sym_b { func($<aa>[sym]); }
;
sym_a: 'a';
sym_b: 'b';
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:676: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y" "named-refs.at:676"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:12.22-31: error: invalid reference: '\$sym.field'
test.y:12.3-35: note: symbol not found in production: sym
test.y:13.22-35: error: invalid reference: '\$<aa>sym.field'
test.y:13.3-39: note: symbol not found in production: sym
test.y:14.22-33: error: invalid reference: '\$[sym.field]'
test.y:14.3-37: note: symbol not found in production: sym.field
test.y:15.22-37: error: invalid reference: '\$<aa>[sym.field]'
test.y:15.3-41: note: symbol not found in production: sym.field
test.y:16.22-25: error: invalid reference: '\$sym'
test.y:16.3-29: note: symbol not found in production: sym
test.y:17.22-29: error: invalid reference: '\$<aa>sym'
test.y:17.3-33: note: symbol not found in production: sym
test.y:18.22-27: error: invalid reference: '\$[sym]'
test.y:18.3-65: note: symbol not found in production before \$3: sym
test.y:18.52-61: error: invalid reference: '\$<aa>[sym]'
test.y:18.3-65: note: symbol not found in production: sym
test.y:22.22-31: error: invalid reference: '\$sym-field'
test.y:22.3-35: note: symbol not found in production: sym
test.y:23.22-35: error: invalid reference: '\$<aa>sym-field'
test.y:23.3-39: note: symbol not found in production: sym
test.y:24.22-33: error: invalid reference: '\$[sym-field]'
test.y:24.3-37: note: symbol not found in production: sym-field
test.y:25.22-37: error: invalid reference: '\$<aa>[sym-field]'
test.y:25.3-41: note: symbol not found in production: sym-field
test.y:26.22-25: error: invalid reference: '\$sym'
test.y:26.3-29: note: symbol not found in production: sym
test.y:27.22-29: error: invalid reference: '\$<aa>sym'
test.y:27.3-33: note: symbol not found in production: sym
test.y:28.22-27: error: invalid reference: '\$[sym]'
test.y:28.3-65: note: symbol not found in production before \$3: sym
test.y:28.52-61: error: invalid reference: '\$<aa>[sym]'
test.y:28.3-65: note: symbol not found in production: sym
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:676"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_81
#AT_START_82
at_fn_group_banner 82 'named-refs.at:715' \
"\$ or @ followed by . or -" " " 3
at_xfail=no
(
printf "%s\n" "82. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%%
start:
.field { $.field; }
| 'a' { @.field; }
;
.field: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y" "named-refs.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:4.12-18: error: invalid reference: '\$.field'
test.y:4.13: note: syntax error after '\$', expecting integer, letter, '_', '[', or '\$'
test.y:4.3-8: note: possibly meant: \$[.field] at \$1
test.y:5.12-18: error: invalid reference: '@.field'
test.y:5.13: note: syntax error after '@', expecting integer, letter, '_', '[', or '\$'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >test.y <<'_ATEOF'
%%
start:
'a' { $-field; }
| 'b' { @-field; }
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv test.y"
at_fn_check_prepare_notrace 'an embedded newline' "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y" "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:740"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "named-refs.at:740"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "named-refs.at:740"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret test.y"
at_fn_check_prepare_trace "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "test.y:4.9: warning: stray '\$' [-Wother]
test.y:5.9: warning: stray '@' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror" "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
test.y:4.9: warning: stray '$' [-Wother]
test.y:5.9: warning: stray '@' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "named-refs.at:740"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error" "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none" "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/named-refs.at:740: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none" "named-refs.at:740"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret test.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/named-refs.at:740"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_82
#AT_START_83
at_fn_group_banner 83 'output.at:68' \
"Output files: -dv" " " 4
at_xfail=no
(
printf "%s\n" "83. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.output foo.tab.c foo.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:68"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y" "output.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:68"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:68"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv foo.y"
at_fn_check_prepare_trace "output.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:68: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:68"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.c foo.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_83
#AT_START_84
at_fn_group_banner 84 'output.at:74' \
"Output files: -dv >&-" " " 4
at_xfail=no
(
printf "%s\n" "84. $at_setup_line: testing $at_desc ..."
$at_traceon
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: case \"\$PREBISON\" in *valgrind*) exit 77;; esac"
at_fn_check_prepare_dynamic "case \"$PREBISON\" in *valgrind*) exit 77;; esac" "output.at:74"
( $at_check_trace; case "$PREBISON" in *valgrind*) exit 77;; esac
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
for file in foo.y foo.output foo.tab.c foo.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:74"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:74"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv >&- foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:74"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv >&- foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y" "output.at:74"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv >&- foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:74"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:74"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:74"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv >&- foo.y"
at_fn_check_prepare_trace "output.at:74"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv >&- foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:74: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:74"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.c foo.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_84
#AT_START_85
at_fn_group_banner 85 'output.at:81' \
"Output files: -dv -o foo.c" " " 4
at_xfail=no
(
printf "%s\n" "85. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.c foo.h foo.output; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:81"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:81"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -o foo.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y" "output.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:81"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:81"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:81"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -o foo.c foo.y"
at_fn_check_prepare_trace "output.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:81"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c foo.h foo.output
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:81: grep '#include \"foo.h\"' foo.c"
at_fn_check_prepare_trace "output.at:81"
( $at_check_trace; grep '#include "foo.h"' foo.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_85
#AT_START_86
at_fn_group_banner 86 'output.at:84' \
"Output files: -dv -y" " " 4
at_xfail=no
(
printf "%s\n" "86. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.output y.tab.c y.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:84"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:84"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -y foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:84"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y" "output.at:84"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:84"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:84"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:84"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -y foo.y"
at_fn_check_prepare_trace "output.at:84"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:84"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.output y.tab.c y.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:84: grep '#include \"y.tab.h\"' y.tab.c"
at_fn_check_prepare_trace "output.at:84"
( $at_check_trace; grep '#include "y.tab.h"' y.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 1 $at_status "$at_srcdir/output.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_86
#AT_START_87
at_fn_group_banner 87 'output.at:87' \
"Output files: api.header.include={\"./foo.h\"} -dv -y" "" 4
at_xfail=no
(
printf "%s\n" "87. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.output y.tab.c y.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%define api.header.include {"./foo.h"}
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:87"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:87"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -y foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:87"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y" "output.at:87"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:87"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:87"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -y foo.y"
at_fn_check_prepare_trace "output.at:87"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:87"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.output y.tab.c y.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:87: grep '#include \"./foo.h\"' y.tab.c"
at_fn_check_prepare_trace "output.at:87"
( $at_check_trace; grep '#include "./foo.h"' y.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:87"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_87
#AT_START_88
at_fn_group_banner 88 'output.at:92' \
"Output files: -dv -o foo.tab.c" " " 4
at_xfail=no
(
printf "%s\n" "88. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.output foo.tab.c foo.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:92"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:92"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -o foo.tab.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:92"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y" "output.at:92"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:92"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:92"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:92"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -o foo.tab.c foo.y"
at_fn_check_prepare_trace "output.at:92"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -o foo.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:92: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:92"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.c foo.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:92"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_88
#AT_START_89
at_fn_group_banner 89 'output.at:95' \
"Output files: --fixed-output-files -dv -g --html" "" 4
at_xfail=no
(
printf "%s\n" "89. $at_setup_line: testing $at_desc ..."
$at_traceon
printf "%s\n" "output.at:95" >"$at_check_line_file"
(test x"$XSLTPROC" = x) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:95"
for file in foo.y y.gv y.html y.output y.tab.c y.tab.h y.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:95"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:95"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --fixed-output-files -dv -g --html foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --fixed-output-files -dv -g --html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --fixed-output-files -dv -g --html foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --fixed-output-files -dv -g --html foo.y" "output.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --fixed-output-files -dv -g --html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:95"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:95"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:95"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --fixed-output-files -dv -g --html foo.y"
at_fn_check_prepare_trace "output.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --fixed-output-files -dv -g --html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:95: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:95"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.gv y.html y.output y.tab.c y.tab.h y.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_89
#AT_START_90
at_fn_group_banner 90 'output.at:97' \
"Output files: -Hfoo.header -v -gfoo.gv --html=foo.html" "" 4
at_xfail=no
(
printf "%s\n" "90. $at_setup_line: testing $at_desc ..."
$at_traceon
printf "%s\n" "output.at:97" >"$at_check_line_file"
(test x"$XSLTPROC" = x) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:97"
for file in foo.y foo.gv foo.header foo.html foo.output foo.tab.c foo.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:97"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:97"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Hfoo.header -v -gfoo.gv --html=foo.html foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:97"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Hfoo.header -v -gfoo.gv --html=foo.html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Hfoo.header -v -gfoo.gv --html=foo.html foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Hfoo.header -v -gfoo.gv --html=foo.html foo.y" "output.at:97"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Hfoo.header -v -gfoo.gv --html=foo.html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:97"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:97"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Hfoo.header -v -gfoo.gv --html=foo.html foo.y"
at_fn_check_prepare_trace "output.at:97"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Hfoo.header -v -gfoo.gv --html=foo.html foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:97: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:97"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.gv foo.header foo.html foo.output foo.tab.c foo.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_90
#AT_START_91
at_fn_group_banner 91 'output.at:100' \
"Output files: -dv -g --xml --fixed-output-files" "" 4
at_xfail=no
(
printf "%s\n" "91. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.gv y.output y.tab.c y.tab.h y.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:100"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:100"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -g --xml --fixed-output-files foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:100"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -g --xml --fixed-output-files foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files foo.y" "output.at:100"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml --fixed-output-files foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:100"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:100"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:100"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml --fixed-output-files foo.y"
at_fn_check_prepare_trace "output.at:100"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml --fixed-output-files foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:100: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:100"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.gv y.output y.tab.c y.tab.h y.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:100"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_91
#AT_START_92
at_fn_group_banner 92 'output.at:102' \
"Output files: -dv -g --xml -y" " " 4
at_xfail=no
(
printf "%s\n" "92. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.gv y.output y.tab.c y.tab.h y.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:102"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:102"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -g --xml -y foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:102"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" "output.at:102"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:102"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:102"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:102"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -y foo.y"
at_fn_check_prepare_trace "output.at:102"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:102: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:102"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.gv y.output y.tab.c y.tab.h y.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_92
#AT_START_93
at_fn_group_banner 93 'output.at:104' \
"Output files: %require \"3.4\" -dv -g --xml -y" " " 4
at_xfail=no
(
printf "%s\n" "93. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.gv y.output y.tab.c y.tab.h y.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%require "3.4"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:104"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:104"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -g --xml -y foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:104"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y" "output.at:104"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:104"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:104"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:104"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -y foo.y"
at_fn_check_prepare_trace "output.at:104"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:104: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:104"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.gv y.output y.tab.c y.tab.h y.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_93
#AT_START_94
at_fn_group_banner 94 'output.at:107' \
"Output files: -dv -g --xml -o y.tab.c" " " 4
at_xfail=no
(
printf "%s\n" "94. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.gv y.output y.tab.c y.tab.h y.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:107"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:107"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:107"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -g --xml -o y.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y" "output.at:107"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g --xml -o y.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:107"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:107"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:107"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -o y.tab.c foo.y"
at_fn_check_prepare_trace "output.at:107"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g --xml -o y.tab.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:107: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:107"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.gv y.output y.tab.c y.tab.h y.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:107"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_94
#AT_START_95
at_fn_group_banner 95 'output.at:110' \
"Output files: -dv -b bar" " " 4
at_xfail=no
(
printf "%s\n" "95. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y bar.output bar.tab.c bar.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:110"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:110"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -b bar foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:110"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y" "output.at:110"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:110"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:110"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:110"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -b bar foo.y"
at_fn_check_prepare_trace "output.at:110"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -b bar foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:110: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:110"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "bar.output bar.tab.c bar.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_95
#AT_START_96
at_fn_group_banner 96 'output.at:112' \
"Output files: -dv -g -o foo.c" " " 4
at_xfail=no
(
printf "%s\n" "96. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.c foo.gv foo.h foo.output; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:112"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:112"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -dv -g -o foo.c foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:112"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y" "output.at:112"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:112"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:112"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:112"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g -o foo.c foo.y"
at_fn_check_prepare_trace "output.at:112"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -dv -g -o foo.c foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:112: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:112"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c foo.gv foo.h foo.output
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:112"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_96
#AT_START_97
at_fn_group_banner 97 'output.at:116' \
"Output files: %header %verbose " " " 4
at_xfail=no
(
printf "%s\n" "97. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.output foo.tab.c foo.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:116"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:116"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:116"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y"
at_fn_check_prepare_trace "output.at:116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:116: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:116"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.c foo.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:116"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_97
#AT_START_98
at_fn_group_banner 98 'output.at:118' \
"Output files: %header %verbose %yacc " " " 4
at_xfail=no
(
printf "%s\n" "98. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y y.output y.tab.c y.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%header %verbose %yacc
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:118"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:118"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:118"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:118"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:118"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y"
at_fn_check_prepare_trace "output.at:118"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:118: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:118"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.output y.tab.c y.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:118"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_98
#AT_START_99
at_fn_group_banner 99 'output.at:121' \
"Output files: %header %verbose %yacc " " " 4
at_xfail=no
(
printf "%s\n" "99. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy y.output y.tab.c y.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%header %verbose %yacc
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:121"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:121"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:121"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:121"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:121"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:121"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:121"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:121"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:121: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:121"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "y.output y.tab.c y.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_99
#AT_START_100
at_fn_group_banner 100 'output.at:125' \
"Output files: %file-prefix \"bar\" %header %verbose " "" 4
at_xfail=no
(
printf "%s\n" "100. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y bar.output bar.tab.c bar.tab.h; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%file-prefix "bar" %header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:125"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:125"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:125"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:125"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:125"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y"
at_fn_check_prepare_trace "output.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:125: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:125"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "bar.output bar.tab.c bar.tab.h
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_100
#AT_START_101
at_fn_group_banner 101 'output.at:127' \
"Output files: %output \"bar.c\" %header %verbose %yacc " "" 4
at_xfail=no
(
printf "%s\n" "101. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y bar.c bar.h bar.output; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%output "bar.c" %header %verbose %yacc
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:127"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:127"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:127"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:127"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:127"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:127"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:127"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y"
at_fn_check_prepare_trace "output.at:127"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:127: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:127"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "bar.c bar.h bar.output
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_101
#AT_START_102
at_fn_group_banner 102 'output.at:129' \
"Output files: %file-prefix \"baz\" %output \"bar.c\" %header %verbose %yacc " "" 4
at_xfail=no
(
printf "%s\n" "102. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y bar.c bar.h bar.output; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%file-prefix "baz" %output "bar.c" %header %verbose %yacc
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:129"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:129"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:129"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y" "output.at:129"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:129"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:129"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:129"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y"
at_fn_check_prepare_trace "output.at:129"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:129: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:129"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "bar.c bar.h bar.output
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:129"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_102
#AT_START_103
at_fn_group_banner 103 'output.at:136' \
"Output files: %header %verbose " " " 4
at_xfail=no
(
printf "%s\n" "103. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.output foo.tab.cc foo.tab.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:136"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:136"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:136"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:136"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:136"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:136"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:136"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:136"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:136: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:136"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc foo.tab.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:136"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_103
#AT_START_104
at_fn_group_banner 104 'output.at:139' \
"Output files: %header %verbose -o foo.c" " " 4
at_xfail=no
(
printf "%s\n" "104. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c foo.h foo.output; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:139"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:139"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o foo.c foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy" "output.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c foo.yy"
at_fn_check_prepare_trace "output.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:139: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:139"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c foo.h foo.output
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_104
#AT_START_105
at_fn_group_banner 105 'output.at:142' \
"Output files: --header=foo.hpp -o foo.c++" " " 4
at_xfail=no
(
printf "%s\n" "105. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.hpp; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:142"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:142"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:142"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy" "output.at:142"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:142"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:142"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:142"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:142"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:142: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:142"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.hpp
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:142"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_105
#AT_START_106
at_fn_group_banner 106 'output.at:146' \
"Output files: --header=foo.hpp -o foo.c++" " " 4
at_xfail=no
(
printf "%s\n" "106. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.hpp; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:146"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:146"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy" "output.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:146"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:146"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:146"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header=foo.hpp -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header=foo.hpp -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:146: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:146"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.hpp
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_106
#AT_START_107
at_fn_group_banner 107 'output.at:150' \
"Output files: %header \"foo.hpp\" -o foo.c++" " " 4
at_xfail=no
(
printf "%s\n" "107. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.hpp; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%header "foo.hpp"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:150"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:150"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:150"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:150"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:150"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:150"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:150: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:150"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.hpp
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:150"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_107
#AT_START_108
at_fn_group_banner 108 'output.at:154' \
"Output files: -o foo.c++ --graph=foo.gph" " " 4
at_xfail=no
(
printf "%s\n" "108. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.gph; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:154"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:154"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:154"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:154"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:154"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:154"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:154"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ --graph=foo.gph foo.yy"
at_fn_check_prepare_trace "output.at:154"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ --graph=foo.gph foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:154: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:154"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.gph
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:154"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_108
#AT_START_109
at_fn_group_banner 109 'output.at:160' \
"Output files: %type <foo> useless --header --graph --xml --report=all -Wall -Werror" "" 4
at_xfail=no
(
printf "%s\n" "109. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.gv foo.output foo.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%type <foo> useless
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:160: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:160"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:160: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:160"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:160: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y" "output.at:160"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:160: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:160"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.gv foo.output foo.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:160"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_109
#AT_START_110
at_fn_group_banner 110 'output.at:167' \
"Output files: useless=--header --graph --xml --report=all -Wall -Werror" "" 4
at_xfail=no
(
printf "%s\n" "110. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.y foo.gv foo.output foo.xml; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.y <<'_ATEOF'
%define useless
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.y >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:167: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.y || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.y || exit 77" "output.at:167"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.y || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:167: rm -f foo.y.bak"
at_fn_check_prepare_trace "output.at:167"
( $at_check_trace; rm -f foo.y.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:167: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y" "output.at:167"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header --graph --xml --report=all -Wall -Werror foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:167: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.y|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:167"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.y|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.gv foo.output foo.xml
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:167"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_110
#AT_START_111
at_fn_group_banner 111 'output.at:173' \
"Output files: %defines -o foo.c++" " " 4
at_xfail=no
(
printf "%s\n" "111. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.h++; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%defines
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:173"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:173"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:173"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:173"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:173"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:173"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:173"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:173"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:173: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:173"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.h++
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:173"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_111
#AT_START_112
at_fn_group_banner 112 'output.at:176' \
"Output files: %defines \"foo.hpp\" -o foo.c++" " " 4
at_xfail=no
(
printf "%s\n" "112. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.c++ foo.hpp; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%defines "foo.hpp"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:176"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:176"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o foo.c++ foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:176"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy" "output.at:176"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:176"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:176"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:176"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy"
at_fn_check_prepare_trace "output.at:176"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o foo.c++ foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:176: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:176"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.c++ foo.hpp
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:176"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_112
#AT_START_113
at_fn_group_banner 113 'output.at:191' \
"Output files: lalr1.cc " " " 4
at_xfail=no
(
printf "%s\n" "113. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.tab.cc; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:191"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:191"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:191"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:191"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:191"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:191: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:191"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.tab.cc
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_113
#AT_START_114
at_fn_group_banner 114 'output.at:194' \
"Output files: lalr1.cc %verbose " " " 4
at_xfail=no
(
printf "%s\n" "114. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.output foo.tab.cc; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:194"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:194"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:194"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:194"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:194"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:194: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:194"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_114
#AT_START_115
at_fn_group_banner 115 'output.at:197' \
"Output files: lalr1.cc %header %verbose " " " 4
at_xfail=no
(
printf "%s\n" "115. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.output foo.tab.cc foo.tab.hh stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:197"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:197"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:197"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:197"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:197"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:197"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:197"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:197"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:197: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:197"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc foo.tab.hh stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:197"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_115
#AT_START_116
at_fn_group_banner 116 'output.at:200' \
"Output files: lalr1.cc %verbose %locations " " " 4
at_xfail=no
(
printf "%s\n" "116. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.output foo.tab.cc; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %verbose %locations
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:200"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:200"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:200"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:200"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:200"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:200"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:200"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:200"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:200: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:200"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:200"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_116
#AT_START_117
at_fn_group_banner 117 'output.at:203' \
"Output files: lalr1.cc %header %verbose %locations " "" 4
at_xfail=no
(
printf "%s\n" "117. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.output foo.tab.cc foo.tab.hh location.hh position.hh stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %verbose %locations
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:203"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:203"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:203"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:203"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:203"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:203"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:203"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:203"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:203: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:203"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc foo.tab.hh location.hh position.hh stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:203"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_117
#AT_START_118
at_fn_group_banner 118 'output.at:206' \
"Output files: lalr1.cc %header %verbose " " " 4
at_xfail=no
(
printf "%s\n" "118. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in subdir/foo.yy foo.output foo.tab.cc foo.tab.hh stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >subdir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %verbose
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' subdir/foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" subdir/foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" subdir/foo.yy || exit 77" "output.at:206"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" subdir/foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: rm -f subdir/foo.yy.bak"
at_fn_check_prepare_trace "output.at:206"
( $at_check_trace; rm -f subdir/foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv subdir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:206"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy" "output.at:206"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:206"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:206"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:206"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret subdir/foo.yy"
at_fn_check_prepare_trace "output.at:206"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:206"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(subdir/foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.output foo.tab.cc foo.tab.hh stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
# Also make sure that the includes do not refer to the subdirectory.
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: grep 'include .subdir/' foo.tab.cc"
at_fn_check_prepare_trace "output.at:206"
( $at_check_trace; grep 'include .subdir/' foo.tab.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:206: grep 'include .subdir/' foo.tab.hh"
at_fn_check_prepare_trace "output.at:206"
( $at_check_trace; grep 'include .subdir/' foo.tab.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:206"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_118
#AT_START_119
at_fn_group_banner 119 'output.at:210' \
"Output files: lalr1.cc %header %verbose %locations -o subdir/foo.cc" "" 4
at_xfail=no
(
printf "%s\n" "119. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in subdir/foo.yy subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/position.hh subdir/stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >subdir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %verbose %locations
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' subdir/foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" subdir/foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" subdir/foo.yy || exit 77" "output.at:210"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" subdir/foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: rm -f subdir/foo.yy.bak"
at_fn_check_prepare_trace "output.at:210"
( $at_check_trace; rm -f subdir/foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:210"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy" "output.at:210"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:210"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:210"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:210"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o subdir/foo.cc subdir/foo.yy"
at_fn_check_prepare_trace "output.at:210"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o subdir/foo.cc subdir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(subdir/foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:210"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(subdir/foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "subdir/foo.cc subdir/foo.hh subdir/foo.output subdir/location.hh subdir/position.hh subdir/stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
# Also make sure that the includes do not refer to the subdirectory.
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: grep 'include .subdir/' subdir/foo.cc"
at_fn_check_prepare_trace "output.at:210"
( $at_check_trace; grep 'include .subdir/' subdir/foo.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:210: grep 'include .subdir/' subdir/foo.hh"
at_fn_check_prepare_trace "output.at:210"
( $at_check_trace; grep 'include .subdir/' subdir/foo.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:210"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_119
#AT_START_120
at_fn_group_banner 120 'output.at:215' \
"Output files: lalr1.cc %header %verbose %file-prefix \"output_dir/foo\" " "" 4
at_xfail=no
(
printf "%s\n" "120. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in gram_dir/foo.yy output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >gram_dir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %verbose %file-prefix "output_dir/foo"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' gram_dir/foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" gram_dir/foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" gram_dir/foo.yy || exit 77" "output.at:215"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" gram_dir/foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: rm -f gram_dir/foo.yy.bak"
at_fn_check_prepare_trace "output.at:215"
( $at_check_trace; rm -f gram_dir/foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv gram_dir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:215"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" "output.at:215"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:215"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:215"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:215"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret gram_dir/foo.yy"
at_fn_check_prepare_trace "output.at:215"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:215: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:215"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(gram_dir/foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:215"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_120
#AT_START_121
at_fn_group_banner 121 'output.at:220' \
"Output files: lalr1.cc %header %locations %verbose %file-prefix \"output_dir/foo\" " "" 4
at_xfail=no
(
printf "%s\n" "121. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in gram_dir/foo.yy output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/location.hh output_dir/position.hh output_dir/stack.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >gram_dir/foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %locations %verbose %file-prefix "output_dir/foo"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' gram_dir/foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" gram_dir/foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" gram_dir/foo.yy || exit 77" "output.at:220"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" gram_dir/foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: rm -f gram_dir/foo.yy.bak"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; rm -f gram_dir/foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv gram_dir/foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy" "output.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:220"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret gram_dir/foo.yy"
at_fn_check_prepare_trace "output.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret gram_dir/foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:220: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(gram_dir/foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:220"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(gram_dir/foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "output_dir/foo.output output_dir/foo.tab.cc output_dir/foo.tab.hh output_dir/location.hh output_dir/position.hh output_dir/stack.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_121
#AT_START_122
at_fn_group_banner 122 'output.at:226' \
"Output files: lalr1.cc %header %locations api.location.file=none %require \"3.2\" " "" 4
at_xfail=no
(
printf "%s\n" "122. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.tab.cc foo.tab.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %locations %define api.location.file none %require "3.2"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:226"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:226"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:226"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:226"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:226"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:226"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:226"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:226: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:226"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.tab.cc foo.tab.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:226"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_122
#AT_START_123
at_fn_group_banner 123 'output.at:231' \
"Output files: lalr1.cc %header %locations api.location.file=\"foo.loc.hh\" %require \"3.2\" " "" 4
at_xfail=no
(
printf "%s\n" "123. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.loc.hh foo.tab.cc foo.tab.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %locations %define api.location.file "foo.loc.hh" %require "3.2"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:231"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:231"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:231"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:231"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:231"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:231"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:231"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:231: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:231"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.loc.hh foo.tab.cc foo.tab.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:231"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_123
#AT_START_124
at_fn_group_banner 124 'output.at:237' \
"Output files: lalr1.cc %header %locations api.location.file=\"\$at_dir/foo.loc.hh\" %require \"3.2\" " "" 4
at_xfail=no
(
printf "%s\n" "124. $at_setup_line: testing $at_desc ..."
$at_traceon
for file in foo.yy foo.loc.hh foo.tab.cc foo.tab.hh; do
case $file in
*/*) mkdir -p `echo "$file" | sed 's,/[^/]*,,'`;;
esac
done
cat >foo.yy <<'_ATEOF'
%skeleton "lalr1.cc" %header %locations %define api.location.file "$at_dir/foo.loc.hh" %require "3.2"
%%
foo: '0' {};
_ATEOF
# There is no AT_DATA_UNQUOTED.
if $EGREP 'at_dir' foo.yy >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: \"\$PERL\" -pi -e 's{\\\$at_dir}'\"{\$at_group_dir}g\" foo.yy || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" -pi -e 's{\\$at_dir}'\"{$at_group_dir}g\" foo.yy || exit 77" "output.at:237"
( $at_check_trace; "$PERL" -pi -e 's{\$at_dir}'"{$at_group_dir}g" foo.yy || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
# On Cygwin, up to Perl 5.28, 'perl -pi' left a foo.bak file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: rm -f foo.yy.bak"
at_fn_check_prepare_trace "output.at:237"
( $at_check_trace; rm -f foo.yy.bak
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv foo.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:237"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy" "output.at:237"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:237"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:237"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:237"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy"
at_fn_check_prepare_trace "output.at:237"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret foo.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
# Ignore the files non-generated files
{ set +x
printf "%s\n" "$at_srcdir/output.at:237: find . -type f |
\"\$PERL\" -ne '
s,\\./,,; chomp;
push @file, \$_ unless m{^(foo.yy|testsuite.log)\$};
END { print join (\" \", sort @file), \"\\n\" }' || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:237"
( $at_check_trace; find . -type f |
"$PERL" -ne '
s,\./,,; chomp;
push @file, $_ unless m{^(foo.yy|testsuite.log)$};
END { print join (" ", sort @file), "\n" }' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "foo.loc.hh foo.tab.cc foo.tab.hh
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_124
#AT_START_125
at_fn_group_banner 125 'output.at:267' \
"Conflicting output files: --graph=\"foo.tab.c\"" " " 4
at_xfail=no
(
printf "%s\n" "125. $at_setup_line: testing $at_desc ..."
$at_traceon
case "foo.y" in
*/*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%%
foo: {};
_ATEOF
cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML. AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y"
at_fn_check_prepare_trace "output.at:267"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "foo.y: warning: conflicting outputs to file 'foo.tab.c' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Werror" "output.at:267"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
foo.y: warning: conflicting outputs to file 'foo.tab.c' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:267"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=error" "output.at:267"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y -Wnone,none -Werror --trace=none" "output.at:267"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"foo.tab.c\" foo.y --warnings=none -Werror --trace=none" "output.at:267"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="foo.tab.c" foo.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:267: cat foo.y"
at_fn_check_prepare_trace "output.at:267"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:267"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_125
#AT_START_126
at_fn_group_banner 126 'output.at:272' \
"Conflicting output files: %header \"foo.output\" -v" "" 4
at_xfail=no
(
printf "%s\n" "126. $at_setup_line: testing $at_desc ..."
$at_traceon
case "foo.y" in
*/*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%header "foo.output"
%%
foo: {};
_ATEOF
cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML. AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v foo.y"
at_fn_check_prepare_trace "output.at:272"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "foo.y: warning: conflicting outputs to file 'foo.output' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror" "output.at:272"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
foo.y: warning: conflicting outputs to file 'foo.output' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:272"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error" "output.at:272"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none" "output.at:272"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none" "output.at:272"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -v foo.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:272: cat foo.y"
at_fn_check_prepare_trace "output.at:272"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:272"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_126
#AT_START_127
at_fn_group_banner 127 'output.at:277' \
"Conflicting output files: lalr1.cc %header %locations --graph=\"location.hh\"" "" 4
at_xfail=no
(
printf "%s\n" "127. $at_setup_line: testing $at_desc ..."
$at_traceon
case "foo.y" in
*/*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%skeleton "lalr1.cc" %header %locations
%%
foo: {};
_ATEOF
cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML. AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y"
at_fn_check_prepare_trace "output.at:277"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --graph="location.hh" foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "foo.y: warning: conflicting outputs to file 'location.hh' [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Werror" "output.at:277"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
foo.y: warning: conflicting outputs to file 'location.hh' [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "output.at:277"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=error" "output.at:277"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y -Wnone,none -Werror --trace=none" "output.at:277"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph=\"location.hh\" foo.y --warnings=none -Werror --trace=none" "output.at:277"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --graph="location.hh" foo.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:277: cat foo.y"
at_fn_check_prepare_trace "output.at:277"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:277"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_127
#AT_START_128
at_fn_group_banner 128 'output.at:282' \
"Conflicting output files: -o foo.y" " " 4
at_xfail=no
(
printf "%s\n" "128. $at_setup_line: testing $at_desc ..."
$at_traceon
case "foo.y" in
*/*) mkdir `echo "foo.y" | sed 's,/.*,,'`;;
esac
cat >foo.y <<'_ATEOF'
%%
foo: {};
_ATEOF
cp foo.y expout
# Because an output file name conflict is still a warning, Bison exits
# with status 0, so AT_BISON_CHECK does not realize that there may be no
# output file against which to check the XML. AT_BISON_CHECK_NO_XML
# avoids that problem.
{ set +x
printf "%s\n" "$at_srcdir/output.at:282: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y" "output.at:282"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o foo.y foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "foo.y: error: refusing to overwrite the input file 'foo.y'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/output.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:282: cat foo.y"
at_fn_check_prepare_trace "output.at:282"
( $at_check_trace; cat foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_128
#AT_START_129
at_fn_group_banner 129 'output.at:328' \
"Output file name: \`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'" "" 4
at_xfail=no
(
printf "%s\n" "129. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: touch \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.tmp\" || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; touch "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:328"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\" glr.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.h\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:328" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:328"
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.c\" "
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:328"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" --header=\"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\" cxx.y"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" --header="\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: ls \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.hh\""
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; ls "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc" "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:328" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:328"
{ set +x
printf "%s\n" "$at_srcdir/output.at:328: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"\\\`~!@#\\\$%^&*()-=_+{}[]|\\\\:;<>, .'.cc\" "
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:328"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "\`~!@#\$%^&*()-=_+{}[]|\\:;<>, .'.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_129
#AT_START_130
at_fn_group_banner 130 'output.at:335' \
"Output file name: (" " " 4
at_xfail=no
(
printf "%s\n" "130. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: touch \"(.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; touch "(.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"(.c\" --header=\"(.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "(.c" --header="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --header=\"(.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.c\" --header=\"(.h\" glr.y" "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "(.c" --header="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:335"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:335"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"(.c\" --header=\"(.h\" glr.y"
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "(.c" --header="(.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: ls \"(.c\" \"(.h\""
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; ls "(.c" "(.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:335" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:335"
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"(.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"(.c\" " "output.at:335"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "(.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"(.cc\" --header=\"(.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "(.cc" --header="(.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --header=\"(.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"(.cc\" --header=\"(.hh\" cxx.y" "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "(.cc" --header="(.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:335"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:335"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"(.cc\" --header=\"(.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "(.cc" --header="(.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: ls \"(.cc\" \"(.hh\""
at_fn_check_prepare_trace "output.at:335"
( $at_check_trace; ls "(.cc" "(.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:335" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:335"
{ set +x
printf "%s\n" "$at_srcdir/output.at:335: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"(.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"(.cc\" " "output.at:335"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "(.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:335"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_130
#AT_START_131
at_fn_group_banner 131 'output.at:336' \
"Output file name: )" " " 4
at_xfail=no
(
printf "%s\n" "131. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: touch \").tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; touch ").tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \").c\" --header=\").h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o ").c" --header=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").c\" --header=\").h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").c\" --header=\").h\" glr.y" "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o ").c" --header=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \").c\" --header=\").h\" glr.y"
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o ").c" --header=").h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: ls \").c\" \").h\""
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; ls ").c" ").h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:336" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:336"
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \").c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \").c\" " "output.at:336"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c ").c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \").cc\" --header=\").hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o ").cc" --header=").hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").cc\" --header=\").hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \").cc\" --header=\").hh\" cxx.y" "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o ").cc" --header=").hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \").cc\" --header=\").hh\" cxx.y"
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o ").cc" --header=").hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: ls \").cc\" \").hh\""
at_fn_check_prepare_trace "output.at:336"
( $at_check_trace; ls ").cc" ").hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:336" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:336"
{ set +x
printf "%s\n" "$at_srcdir/output.at:336: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \").cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \").cc\" " "output.at:336"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c ").cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:336"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_131
#AT_START_132
at_fn_group_banner 132 'output.at:337' \
"Output file name: #" " " 4
at_xfail=no
(
printf "%s\n" "132. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: touch \"#.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; touch "#.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"#.c\" --header=\"#.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "#.c" --header="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --header=\"#.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.c\" --header=\"#.h\" glr.y" "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "#.c" --header="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"#.c\" --header=\"#.h\" glr.y"
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "#.c" --header="#.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: ls \"#.c\" \"#.h\""
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; ls "#.c" "#.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:337" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:337"
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"#.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"#.c\" " "output.at:337"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "#.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"#.cc\" --header=\"#.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "#.cc" --header="#.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --header=\"#.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"#.cc\" --header=\"#.hh\" cxx.y" "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "#.cc" --header="#.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"#.cc\" --header=\"#.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "#.cc" --header="#.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: ls \"#.cc\" \"#.hh\""
at_fn_check_prepare_trace "output.at:337"
( $at_check_trace; ls "#.cc" "#.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:337" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:337"
{ set +x
printf "%s\n" "$at_srcdir/output.at:337: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"#.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"#.cc\" " "output.at:337"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "#.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:337"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_132
#AT_START_133
at_fn_group_banner 133 'output.at:338' \
"Output file name: @@" " " 4
at_xfail=no
(
printf "%s\n" "133. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: touch \"@@.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; touch "@@.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@@.c\" --header=\"@@.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@@.c" --header="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --header=\"@@.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.c\" --header=\"@@.h\" glr.y" "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@@.c" --header="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@@.c\" --header=\"@@.h\" glr.y"
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@@.c" --header="@@.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: ls \"@@.c\" \"@@.h\""
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; ls "@@.c" "@@.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:338" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:338"
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@@.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@@.c\" " "output.at:338"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@@.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@@.cc\" --header=\"@@.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@@.cc" --header="@@.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --header=\"@@.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@@.cc\" --header=\"@@.hh\" cxx.y" "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@@.cc" --header="@@.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@@.cc\" --header=\"@@.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@@.cc" --header="@@.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: ls \"@@.cc\" \"@@.hh\""
at_fn_check_prepare_trace "output.at:338"
( $at_check_trace; ls "@@.cc" "@@.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:338" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:338"
{ set +x
printf "%s\n" "$at_srcdir/output.at:338: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"@@.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"@@.cc\" " "output.at:338"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "@@.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:338"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_133
#AT_START_134
at_fn_group_banner 134 'output.at:339' \
"Output file name: @{" " " 4
at_xfail=no
(
printf "%s\n" "134. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: touch \"@{.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; touch "@{.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@{.c\" --header=\"@{.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@{.c" --header="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --header=\"@{.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.c\" --header=\"@{.h\" glr.y" "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@{.c" --header="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:339"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:339"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@{.c\" --header=\"@{.h\" glr.y"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@{.c" --header="@{.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: ls \"@{.c\" \"@{.h\""
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; ls "@{.c" "@{.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:339" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:339"
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@{.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@{.c\" " "output.at:339"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@{.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@{.cc\" --header=\"@{.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@{.cc" --header="@{.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --header=\"@{.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@{.cc\" --header=\"@{.hh\" cxx.y" "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@{.cc" --header="@{.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:339"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:339"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@{.cc\" --header=\"@{.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@{.cc" --header="@{.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: ls \"@{.cc\" \"@{.hh\""
at_fn_check_prepare_trace "output.at:339"
( $at_check_trace; ls "@{.cc" "@{.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:339" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:339"
{ set +x
printf "%s\n" "$at_srcdir/output.at:339: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"@{.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"@{.cc\" " "output.at:339"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "@{.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:339"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_134
#AT_START_135
at_fn_group_banner 135 'output.at:340' \
"Output file name: @}" " " 4
at_xfail=no
(
printf "%s\n" "135. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: touch \"@}.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; touch "@}.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@}.c\" --header=\"@}.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@}.c" --header="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --header=\"@}.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.c\" --header=\"@}.h\" glr.y" "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@}.c" --header="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@}.c\" --header=\"@}.h\" glr.y"
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@}.c" --header="@}.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: ls \"@}.c\" \"@}.h\""
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; ls "@}.c" "@}.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:340" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:340"
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"@}.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"@}.c\" " "output.at:340"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "@}.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"@}.cc\" --header=\"@}.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "@}.cc" --header="@}.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --header=\"@}.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"@}.cc\" --header=\"@}.hh\" cxx.y" "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "@}.cc" --header="@}.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"@}.cc\" --header=\"@}.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "@}.cc" --header="@}.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: ls \"@}.cc\" \"@}.hh\""
at_fn_check_prepare_trace "output.at:340"
( $at_check_trace; ls "@}.cc" "@}.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:340" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:340"
{ set +x
printf "%s\n" "$at_srcdir/output.at:340: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"@}.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"@}.cc\" " "output.at:340"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "@}.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:340"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_135
#AT_START_136
at_fn_group_banner 136 'output.at:341' \
"Output file name: [" " " 4
at_xfail=no
(
printf "%s\n" "136. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: touch \"[.tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; touch "[.tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"[.c\" --header=\"[.h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "[.c" --header="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --header=\"[.h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.c\" --header=\"[.h\" glr.y" "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "[.c" --header="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"[.c\" --header=\"[.h\" glr.y"
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "[.c" --header="[.h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: ls \"[.c\" \"[.h\""
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; ls "[.c" "[.h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:341" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:341"
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"[.c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"[.c\" " "output.at:341"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "[.c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"[.cc\" --header=\"[.hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "[.cc" --header="[.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --header=\"[.hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"[.cc\" --header=\"[.hh\" cxx.y" "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "[.cc" --header="[.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"[.cc\" --header=\"[.hh\" cxx.y"
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "[.cc" --header="[.hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: ls \"[.cc\" \"[.hh\""
at_fn_check_prepare_trace "output.at:341"
( $at_check_trace; ls "[.cc" "[.hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:341" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:341"
{ set +x
printf "%s\n" "$at_srcdir/output.at:341: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"[.cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"[.cc\" " "output.at:341"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "[.cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_136
#AT_START_137
at_fn_group_banner 137 'output.at:342' \
"Output file name: ]" " " 4
at_xfail=no
(
printf "%s\n" "137. $at_setup_line: testing $at_desc ..."
$at_traceon
# Skip if platform doesn't support file name. For example, Cygwin
# doesn't support file names containing ":" or "\".
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: touch \"].tmp\" || exit 77"
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; touch "].tmp" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >glr.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"].c\" --header=\"].h\" glr.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "].c" --header="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].c\" --header=\"].h\" glr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].c\" --header=\"].h\" glr.y" "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "].c" --header="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"].c\" --header=\"].h\" glr.y"
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "].c" --header="].h" glr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: ls \"].c\" \"].h\""
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; ls "].c" "].h"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:342" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:342"
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$CC \$CFLAGS \$CPPFLAGS -c -o glr.o -c \"].c\" "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o glr.o -c \"].c\" " "output.at:342"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o glr.o -c "].c"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >cxx.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code { int yylex (yy::parser::semantic_type*); }
%%
start: {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \"].cc\" --header=\"].hh\" cxx.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o "].cc" --header="].hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --header=\"].hh\" cxx.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"].cc\" --header=\"].hh\" cxx.y" "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o "].cc" --header="].hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"].cc\" --header=\"].hh\" cxx.y"
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o "].cc" --header="].hh" cxx.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: ls \"].cc\" \"].hh\""
at_fn_check_prepare_trace "output.at:342"
( $at_check_trace; ls "].cc" "].hh"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:342" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:342"
{ set +x
printf "%s\n" "$at_srcdir/output.at:342: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx.o -c \"].cc\" "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c \"].cc\" " "output.at:342"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx.o -c "].cc"
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_137
#AT_START_138
at_fn_group_banner 138 'output.at:363' \
"Graph with no conflicts" " " 4
at_xfail=no
(
printf "%s\n" "138. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: a '?' b;
a: ;
b: 'b';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:363"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:363: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:363"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • exp \$end\\l 1 exp: • a '?' b\\l 2 a: • %empty\\l\"]
0 -> 1 [style=dashed label=\"exp\"]
0 -> 2 [style=dashed label=\"a\"]
0 -> \"0R2\" [style=solid]
\"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 0 \$accept: exp • \$end\\l\"]
1 -> 3 [style=solid label=\"\$end\"]
2 [label=\"State 2\\n\\l 1 exp: a • '?' b\\l\"]
2 -> 4 [style=solid label=\"'?'\"]
3 [label=\"State 3\\n\\l 0 \$accept: exp \$end •\\l\"]
3 -> \"3R0\" [style=solid]
\"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
4 [label=\"State 4\\n\\l 1 exp: a '?' • b\\l 3 b: • 'b'\\l\"]
4 -> 5 [style=solid label=\"'b'\"]
4 -> 6 [style=dashed label=\"b\"]
5 [label=\"State 5\\n\\l 3 b: 'b' •\\l\"]
5 -> \"5R3\" [style=solid]
\"5R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
6 [label=\"State 6\\n\\l 1 exp: a '?' b •\\l\"]
6 -> \"6R1\" [style=solid]
\"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:363"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_138
#AT_START_139
at_fn_group_banner 139 'output.at:403' \
"Graph with unsolved S/R" " " 4
at_xfail=no
(
printf "%s\n" "139. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
start:
'a'
| empty_a 'a'
| 'b'
| empty_b 'b'
| 'c'
| empty_c 'c'
;
empty_a: %prec 'a';
empty_b: %prec 'b';
empty_c: %prec 'c';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:403"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:403"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:403"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:403: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:403"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • start \$end\\l 1 start: • 'a'\\l 2 | • empty_a 'a'\\l 3 | • 'b'\\l 4 | • empty_b 'b'\\l 5 | • 'c'\\l 6 | • empty_c 'c'\\l 7 empty_a: • %empty ['a']\\l 8 empty_b: • %empty ['b']\\l 9 empty_c: • %empty ['c']\\l\"]
0 -> 1 [style=solid label=\"'a'\"]
0 -> 2 [style=solid label=\"'b'\"]
0 -> 3 [style=solid label=\"'c'\"]
0 -> 4 [style=dashed label=\"start\"]
0 -> 5 [style=dashed label=\"empty_a\"]
0 -> 6 [style=dashed label=\"empty_b\"]
0 -> 7 [style=dashed label=\"empty_c\"]
0 -> \"0R7d\" [label=\"['a']\", style=solid]
\"0R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled]
0 -> \"0R8d\" [label=\"['b']\", style=solid]
\"0R8d\" [label=\"R8\", fillcolor=5, shape=diamond, style=filled]
0 -> \"0R9d\" [label=\"['c']\", style=solid]
\"0R9d\" [label=\"R9\", fillcolor=5, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 1 start: 'a' •\\l\"]
1 -> \"1R1\" [style=solid]
\"1R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
2 [label=\"State 2\\n\\l 3 start: 'b' •\\l\"]
2 -> \"2R3\" [style=solid]
\"2R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
3 [label=\"State 3\\n\\l 5 start: 'c' •\\l\"]
3 -> \"3R5\" [style=solid]
\"3R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
4 [label=\"State 4\\n\\l 0 \$accept: start • \$end\\l\"]
4 -> 8 [style=solid label=\"\$end\"]
5 [label=\"State 5\\n\\l 2 start: empty_a • 'a'\\l\"]
5 -> 9 [style=solid label=\"'a'\"]
6 [label=\"State 6\\n\\l 4 start: empty_b • 'b'\\l\"]
6 -> 10 [style=solid label=\"'b'\"]
7 [label=\"State 7\\n\\l 6 start: empty_c • 'c'\\l\"]
7 -> 11 [style=solid label=\"'c'\"]
8 [label=\"State 8\\n\\l 0 \$accept: start \$end •\\l\"]
8 -> \"8R0\" [style=solid]
\"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
9 [label=\"State 9\\n\\l 2 start: empty_a 'a' •\\l\"]
9 -> \"9R2\" [style=solid]
\"9R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
10 [label=\"State 10\\n\\l 4 start: empty_b 'b' •\\l\"]
10 -> \"10R4\" [style=solid]
\"10R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
11 [label=\"State 11\\n\\l 6 start: empty_c 'c' •\\l\"]
11 -> \"11R6\" [style=solid]
\"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:403"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_139
#AT_START_140
at_fn_group_banner 140 'output.at:473' \
"Graph with solved S/R" " " 4
at_xfail=no
(
printf "%s\n" "140. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%left 'a'
%right 'b'
%right 'c'
%%
start:
'a'
| empty_a 'a'
| 'b'
| empty_b 'b'
| 'c'
| empty_c 'c'
;
empty_a: %prec 'a';
empty_b: %prec 'b';
empty_c: %prec 'c';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:473"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:473"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:473"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:473"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:473"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:473"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:473: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:473"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • start \$end\\l 1 start: • 'a'\\l 2 | • empty_a 'a'\\l 3 | • 'b'\\l 4 | • empty_b 'b'\\l 5 | • 'c'\\l 6 | • empty_c 'c'\\l 7 empty_a: • %empty ['a']\\l 8 empty_b: • %empty []\\l 9 empty_c: • %empty []\\l\"]
0 -> 1 [style=solid label=\"'b'\"]
0 -> 2 [style=solid label=\"'c'\"]
0 -> 3 [style=dashed label=\"start\"]
0 -> 4 [style=dashed label=\"empty_a\"]
0 -> 5 [style=dashed label=\"empty_b\"]
0 -> 6 [style=dashed label=\"empty_c\"]
0 -> \"0R7\" [style=solid]
\"0R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 3 start: 'b' •\\l\"]
1 -> \"1R3\" [style=solid]
\"1R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
2 [label=\"State 2\\n\\l 5 start: 'c' •\\l\"]
2 -> \"2R5\" [style=solid]
\"2R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
3 [label=\"State 3\\n\\l 0 \$accept: start • \$end\\l\"]
3 -> 7 [style=solid label=\"\$end\"]
4 [label=\"State 4\\n\\l 2 start: empty_a • 'a'\\l\"]
4 -> 8 [style=solid label=\"'a'\"]
5 [label=\"State 5\\n\\l 4 start: empty_b • 'b'\\l\"]
5 -> 9 [style=solid label=\"'b'\"]
6 [label=\"State 6\\n\\l 6 start: empty_c • 'c'\\l\"]
6 -> 10 [style=solid label=\"'c'\"]
7 [label=\"State 7\\n\\l 0 \$accept: start \$end •\\l\"]
7 -> \"7R0\" [style=solid]
\"7R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
8 [label=\"State 8\\n\\l 2 start: empty_a 'a' •\\l\"]
8 -> \"8R2\" [style=solid]
\"8R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
9 [label=\"State 9\\n\\l 4 start: empty_b 'b' •\\l\"]
9 -> \"9R4\" [style=solid]
\"9R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
10 [label=\"State 10\\n\\l 6 start: empty_c 'c' •\\l\"]
10 -> \"10R6\" [style=solid]
\"10R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_140
#AT_START_141
at_fn_group_banner 141 'output.at:538' \
"Graph with R/R" " " 4
at_xfail=no
(
printf "%s\n" "141. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: a | b;
a: ;
b: ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:538"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:538"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:538"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:538"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:538"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:538"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:538: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:538"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • exp \$end\\l 1 exp: • a\\l 2 | • b\\l 3 a: • %empty [\$end]\\l 4 b: • %empty [\$end]\\l\"]
0 -> 1 [style=dashed label=\"exp\"]
0 -> 2 [style=dashed label=\"a\"]
0 -> 3 [style=dashed label=\"b\"]
0 -> \"0R3\" [style=solid]
\"0R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
0 -> \"0R4d\" [label=\"[\$end]\", style=solid]
\"0R4d\" [label=\"R4\", fillcolor=5, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 0 \$accept: exp • \$end\\l\"]
1 -> 4 [style=solid label=\"\$end\"]
2 [label=\"State 2\\n\\l 1 exp: a •\\l\"]
2 -> \"2R1\" [style=solid]
\"2R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
3 [label=\"State 3\\n\\l 2 exp: b •\\l\"]
3 -> \"3R2\" [style=solid]
\"3R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
4 [label=\"State 4\\n\\l 0 \$accept: exp \$end •\\l\"]
4 -> \"4R0\" [style=solid]
\"4R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:538"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_141
#AT_START_142
at_fn_group_banner 142 'output.at:576' \
"Graph with reductions with multiple LAT" " " 4
at_xfail=no
(
printf "%s\n" "142. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: a ';' | a ';' | a '.' | b '?' | b '!' | c '?' | c ';';
a: ;
b: ;
c: ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:576"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:576"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:576"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:576"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:576"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:576"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:576: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:576"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • exp \$end\\l 1 exp: • a ';'\\l 2 | • a ';'\\l 3 | • a '.'\\l 4 | • b '?'\\l 5 | • b '!'\\l 6 | • c '?'\\l 7 | • c ';'\\l 8 a: • %empty [';', '.']\\l 9 b: • %empty ['?', '!']\\l 10 c: • %empty [';', '?']\\l\"]
0 -> 1 [style=dashed label=\"exp\"]
0 -> 2 [style=dashed label=\"a\"]
0 -> 3 [style=dashed label=\"b\"]
0 -> 4 [style=dashed label=\"c\"]
0 -> \"0R8\" [style=solid]
\"0R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled]
0 -> \"0R9\" [label=\"['?', '!']\", style=solid]
\"0R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled]
0 -> \"0R10d\" [label=\"[';', '?']\", style=solid]
\"0R10d\" [label=\"R10\", fillcolor=5, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 0 \$accept: exp • \$end\\l\"]
1 -> 5 [style=solid label=\"\$end\"]
2 [label=\"State 2\\n\\l 1 exp: a • ';'\\l 2 | a • ';'\\l 3 | a • '.'\\l\"]
2 -> 6 [style=solid label=\"';'\"]
2 -> 7 [style=solid label=\"'.'\"]
3 [label=\"State 3\\n\\l 4 exp: b • '?'\\l 5 | b • '!'\\l\"]
3 -> 8 [style=solid label=\"'?'\"]
3 -> 9 [style=solid label=\"'!'\"]
4 [label=\"State 4\\n\\l 6 exp: c • '?'\\l 7 | c • ';'\\l\"]
4 -> 10 [style=solid label=\"';'\"]
4 -> 11 [style=solid label=\"'?'\"]
5 [label=\"State 5\\n\\l 0 \$accept: exp \$end •\\l\"]
5 -> \"5R0\" [style=solid]
\"5R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
6 [label=\"State 6\\n\\l 1 exp: a ';' • [\$end]\\l 2 | a ';' • [\$end]\\l\"]
6 -> \"6R1\" [style=solid]
\"6R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
6 -> \"6R2d\" [label=\"[\$end]\", style=solid]
\"6R2d\" [label=\"R2\", fillcolor=5, shape=diamond, style=filled]
7 [label=\"State 7\\n\\l 3 exp: a '.' •\\l\"]
7 -> \"7R3\" [style=solid]
\"7R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
8 [label=\"State 8\\n\\l 4 exp: b '?' •\\l\"]
8 -> \"8R4\" [style=solid]
\"8R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
9 [label=\"State 9\\n\\l 5 exp: b '!' •\\l\"]
9 -> \"9R5\" [style=solid]
\"9R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
10 [label=\"State 10\\n\\l 7 exp: c ';' •\\l\"]
10 -> \"10R7\" [style=solid]
\"10R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
11 [label=\"State 11\\n\\l 6 exp: c '?' •\\l\"]
11 -> \"11R6\" [style=solid]
\"11R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:576"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_142
#AT_START_143
at_fn_group_banner 143 'output.at:641' \
"Graph with a reduction rule both enabled and disabled" "" 4
at_xfail=no
(
printf "%s\n" "143. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: ifexp | opexp | imm;
ifexp: "if" exp "then" exp elseexp;
elseexp: "else" exp | ;
opexp: exp '+' exp;
imm: '0';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -rall --graph input.y"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y" "output.at:641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:641"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:641"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:641"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y"
at_fn_check_prepare_trace "output.at:641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -rall --graph input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:641: grep -v // input.gv"
at_fn_check_prepare_trace "output.at:641"
( $at_check_trace; grep -v // input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • exp \$end\\l 1 exp: • ifexp\\l 2 | • opexp\\l 3 | • imm\\l 4 ifexp: • \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: • exp '+' exp\\l 8 imm: • '0'\\l\"]
0 -> 1 [style=solid label=\"\\\"if\\\"\"]
0 -> 2 [style=solid label=\"'0'\"]
0 -> 3 [style=dashed label=\"exp\"]
0 -> 4 [style=dashed label=\"ifexp\"]
0 -> 5 [style=dashed label=\"opexp\"]
0 -> 6 [style=dashed label=\"imm\"]
1 [label=\"State 1\\n\\l 1 exp: • ifexp\\l 2 | • opexp\\l 3 | • imm\\l 4 ifexp: • \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" • exp \\\"then\\\" exp elseexp\\l 7 opexp: • exp '+' exp\\l 8 imm: • '0'\\l\"]
1 -> 1 [style=solid label=\"\\\"if\\\"\"]
1 -> 2 [style=solid label=\"'0'\"]
1 -> 7 [style=dashed label=\"exp\"]
1 -> 4 [style=dashed label=\"ifexp\"]
1 -> 5 [style=dashed label=\"opexp\"]
1 -> 6 [style=dashed label=\"imm\"]
2 [label=\"State 2\\n\\l 8 imm: '0' •\\l\"]
2 -> \"2R8\" [style=solid]
\"2R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled]
3 [label=\"State 3\\n\\l 0 \$accept: exp • \$end\\l 7 opexp: exp • '+' exp\\l\"]
3 -> 8 [style=solid label=\"\$end\"]
3 -> 9 [style=solid label=\"'+'\"]
4 [label=\"State 4\\n\\l 1 exp: ifexp •\\l\"]
4 -> \"4R1\" [style=solid]
\"4R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
5 [label=\"State 5\\n\\l 2 exp: opexp •\\l\"]
5 -> \"5R2\" [style=solid]
\"5R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
6 [label=\"State 6\\n\\l 3 exp: imm •\\l\"]
6 -> \"6R3\" [style=solid]
\"6R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
7 [label=\"State 7\\n\\l 4 ifexp: \\\"if\\\" exp • \\\"then\\\" exp elseexp\\l 7 opexp: exp • '+' exp\\l\"]
7 -> 10 [style=solid label=\"\\\"then\\\"\"]
7 -> 9 [style=solid label=\"'+'\"]
8 [label=\"State 8\\n\\l 0 \$accept: exp \$end •\\l\"]
8 -> \"8R0\" [style=solid]
\"8R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
9 [label=\"State 9\\n\\l 1 exp: • ifexp\\l 2 | • opexp\\l 3 | • imm\\l 4 ifexp: • \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 7 opexp: • exp '+' exp\\l 7 | exp '+' • exp\\l 8 imm: • '0'\\l\"]
9 -> 1 [style=solid label=\"\\\"if\\\"\"]
9 -> 2 [style=solid label=\"'0'\"]
9 -> 11 [style=dashed label=\"exp\"]
9 -> 4 [style=dashed label=\"ifexp\"]
9 -> 5 [style=dashed label=\"opexp\"]
9 -> 6 [style=dashed label=\"imm\"]
10 [label=\"State 10\\n\\l 1 exp: • ifexp\\l 2 | • opexp\\l 3 | • imm\\l 4 ifexp: • \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 4 | \\\"if\\\" exp \\\"then\\\" • exp elseexp\\l 7 opexp: • exp '+' exp\\l 8 imm: • '0'\\l\"]
10 -> 1 [style=solid label=\"\\\"if\\\"\"]
10 -> 2 [style=solid label=\"'0'\"]
10 -> 12 [style=dashed label=\"exp\"]
10 -> 4 [style=dashed label=\"ifexp\"]
10 -> 5 [style=dashed label=\"opexp\"]
10 -> 6 [style=dashed label=\"imm\"]
11 [label=\"State 11\\n\\l 7 opexp: exp • '+' exp\\l 7 | exp '+' exp • [\$end, \\\"then\\\", \\\"else\\\", '+']\\l\"]
11 -> 9 [style=solid label=\"'+'\"]
11 -> \"11R7d\" [label=\"['+']\", style=solid]
\"11R7d\" [label=\"R7\", fillcolor=5, shape=diamond, style=filled]
11 -> \"11R7\" [style=solid]
\"11R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
12 [label=\"State 12\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp • elseexp\\l 5 elseexp: • \\\"else\\\" exp\\l 6 | • %empty [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp • '+' exp\\l\"]
12 -> 13 [style=solid label=\"\\\"else\\\"\"]
12 -> 9 [style=solid label=\"'+'\"]
12 -> 14 [style=dashed label=\"elseexp\"]
12 -> \"12R6d\" [label=\"[\\\"else\\\", '+']\", style=solid]
\"12R6d\" [label=\"R6\", fillcolor=5, shape=diamond, style=filled]
12 -> \"12R6\" [style=solid]
\"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
13 [label=\"State 13\\n\\l 1 exp: • ifexp\\l 2 | • opexp\\l 3 | • imm\\l 4 ifexp: • \\\"if\\\" exp \\\"then\\\" exp elseexp\\l 5 elseexp: \\\"else\\\" • exp\\l 7 opexp: • exp '+' exp\\l 8 imm: • '0'\\l\"]
13 -> 1 [style=solid label=\"\\\"if\\\"\"]
13 -> 2 [style=solid label=\"'0'\"]
13 -> 15 [style=dashed label=\"exp\"]
13 -> 4 [style=dashed label=\"ifexp\"]
13 -> 5 [style=dashed label=\"opexp\"]
13 -> 6 [style=dashed label=\"imm\"]
14 [label=\"State 14\\n\\l 4 ifexp: \\\"if\\\" exp \\\"then\\\" exp elseexp •\\l\"]
14 -> \"14R4\" [style=solid]
\"14R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
15 [label=\"State 15\\n\\l 5 elseexp: \\\"else\\\" exp • [\$end, \\\"then\\\", \\\"else\\\", '+']\\l 7 opexp: exp • '+' exp\\l\"]
15 -> 9 [style=solid label=\"'+'\"]
15 -> \"15R5d\" [label=\"['+']\", style=solid]
\"15R5d\" [label=\"R5\", fillcolor=5, shape=diamond, style=filled]
15 -> \"15R5\" [style=solid]
\"15R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:641"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_143
#AT_START_144
at_fn_group_banner 144 'output.at:744' \
"C++ Output File Prefix Mapping" " " 4
at_xfail=no
(
printf "%s\n" "144. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST([PREFIX], [DIRECTIVES])
# -------------------------------
mkdir -p out/include/ast
cat >x1.yy <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%define api.namespace {x1}
%header
%locations
%define api.location.file "include/ast/loc.hh"
%code {
static int yylex (x1::parser::value_type *lvalp, x1::parser::location_type *llocp);
}
%%
exp: '0';
%%
/* A C++ error reporting function. */
void
x1::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (x1::parser::value_type *lvalp, x1::parser::location_type *llocp)
{
static char const input[] = "0";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -o out/x1.cc -M out/=bar/ x1.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -o out/x1.cc -M out/=bar/ x1.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x1.cc -M out/=bar/ x1.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x1.cc -M out/=bar/ x1.yy" "output.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x1.cc -M out/=bar/ x1.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:775"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:775"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:775"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o out/x1.cc -M out/=bar/ x1.yy"
at_fn_check_prepare_trace "output.at:775"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o out/x1.cc -M out/=bar/ x1.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:775" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:775"
{ set +x
printf "%s\n" "$at_srcdir/output.at:775: \$CXX \$CPPFLAGS \$CXXFLAGS -Iout/include -c -o out/x1.o out/x1.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -Iout/include -c -o out/x1.o out/x1.cc " "output.at:775"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -Iout/include -c -o out/x1.o out/x1.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:775"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the CPP guard and Doxyen comments.
{ set +x
printf "%s\n" "$at_srcdir/output.at:782: sed -ne 's/#line [0-9][0-9]* \"/#line \"/p;/INCLUDED/p;/\\\\file/{p;n;p;}' out/include/ast/loc.hh"
at_fn_check_prepare_trace "output.at:782"
( $at_check_trace; sed -ne 's/#line [0-9][0-9]* "/#line "/p;/INCLUDED/p;/\\file/{p;n;p;}' out/include/ast/loc.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" " ** \\file bar/include/ast/loc.hh
** Define the x1::location class.
#ifndef YY_YY_BAR_INCLUDE_AST_LOC_HH_INCLUDED
# define YY_YY_BAR_INCLUDE_AST_LOC_HH_INCLUDED
#line \"x1.yy\"
#line \"bar/include/ast/loc.hh\"
#line \"x1.yy\"
#line \"bar/include/ast/loc.hh\"
#endif // !YY_YY_BAR_INCLUDE_AST_LOC_HH_INCLUDED
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:782"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:794: sed -ne 's/^#line [0-9][0-9]* \"/#line \"/p;/INCLUDED/p;/\\\\file/{p;n;p;}' out/x1.hh"
at_fn_check_prepare_trace "output.at:794"
( $at_check_trace; sed -ne 's/^#line [0-9][0-9]* "/#line "/p;/INCLUDED/p;/\\file/{p;n;p;}' out/x1.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" " ** \\file bar/x1.hh
** Define the x1::parser class.
#ifndef YY_YY_BAR_X1_HH_INCLUDED
# define YY_YY_BAR_X1_HH_INCLUDED
#line \"x1.yy\"
#line \"bar/x1.hh\"
#line \"x1.yy\"
#line \"bar/x1.hh\"
#endif // !YY_YY_BAR_X1_HH_INCLUDED
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:794"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x2.yy <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%define api.namespace {x2}
%header
%locations
%code requires {#include "include/ast/loc.hh"}
%define api.location.type {x1::location}
%code {
static int yylex (x2::parser::value_type *lvalp, x2::parser::location_type *llocp);
}
%%
exp: '0';
%%
/* A C++ error reporting function. */
void
x2::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (x2::parser::value_type *lvalp, x2::parser::location_type *llocp)
{
static char const input[] = "0";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -o out/x2.cc -M out/=bar/ x2.yy"
at_fn_check_prepare_notrace 'an embedded newline' "output.at:806"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -o out/x2.cc -M out/=bar/ x2.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x2.cc -M out/=bar/ x2.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x2.cc -M out/=bar/ x2.yy" "output.at:806"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o out/x2.cc -M out/=bar/ x2.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:806"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "output.at:806"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "output.at:806"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o out/x2.cc -M out/=bar/ x2.yy"
at_fn_check_prepare_trace "output.at:806"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o out/x2.cc -M out/=bar/ x2.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "output.at:806" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:806"
{ set +x
printf "%s\n" "$at_srcdir/output.at:806: \$CXX \$CPPFLAGS \$CXXFLAGS -Iout/include -c -o out/x2.o out/x2.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -Iout/include -c -o out/x2.o out/x2.cc " "output.at:806"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -Iout/include -c -o out/x2.o out/x2.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:806"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "x1.hh"
#include "x2.hh"
#define RUN(S) \
do { \
S::parser parser; \
int res = parser.parse(); \
if (res) \
std::cerr << #S": " << res << '\n'; \
} while (false)
int
main (void)
{
RUN(x1);
RUN(x2);
}
_ATEOF
# main.cc
printf "%s\n" "output.at:835" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/output.at:835"
{ set +x
printf "%s\n" "$at_srcdir/output.at:835: \$CXX \$CPPFLAGS \$CXXFLAGS -Iout/ \$LDFLAGS -o parser out/x[12].o main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -Iout/ $LDFLAGS -o parser out/x[12].o main.cc $LIBS" "output.at:835"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -Iout/ $LDFLAGS -o parser out/x[12].o main.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/output.at:835"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:836: \$PREPARSER ./parser"
at_fn_check_prepare_dynamic " $PREPARSER ./parser" "output.at:836"
( $at_check_trace; $PREPARSER ./parser
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:836"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/output.at:836: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "output.at:836"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/output.at:836"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_144
#AT_START_145
at_fn_group_banner 145 'diagnostics.at:84' \
"Warnings" " " 5
at_xfail=no
(
printf "%s\n" "145. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:84" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:84"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token FOO FOO FOO
%token FOO FOO FOO
%%
exp: %empty;
_ATEOF
cat >experr <<'_ATEOF'
input.y:9.12-14: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
9 | %token FOO <warning>FOO</warning> FOO
| <warning>^~~</warning>
input.y:9.8-10: <note>note:</note> previous declaration
9 | %token <note>FOO</note> FOO FOO
| <note>^~~</note>
input.y:9.16-18: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
9 | %token FOO FOO <warning>FOO</warning>
| <warning>^~~</warning>
input.y:9.8-10: <note>note:</note> previous declaration
9 | %token <note>FOO</note> FOO FOO
| <note>^~~</note>
input.y:10.8-10: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
10 | %token <warning>FOO</warning> FOO FOO
| <warning>^~~</warning>
input.y:9.8-10: <note>note:</note> previous declaration
9 | %token <note>FOO</note> FOO FOO
| <note>^~~</note>
input.y:10.13-15: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
10 | %token FOO <warning>FOO</warning> FOO
| <warning>^~~</warning>
input.y:9.8-10: <note>note:</note> previous declaration
9 | %token <note>FOO</note> FOO FOO
| <note>^~~</note>
input.y:10.18-20: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
10 | %token FOO FOO <warning>FOO</warning>
| <warning>^~~</warning>
input.y:9.8-10: <note>note:</note> previous declaration
9 | %token <note>FOO</note> FOO FOO
| <note>^~~</note>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:84: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:84"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:84: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:84"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:84: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:84"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:84: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:84"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_145
#AT_START_146
at_fn_group_banner 146 'diagnostics.at:133' \
"Single point locations" " " 5
at_xfail=no
(
printf "%s\n" "146. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:133" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:133"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: a b c d e
a: {}
b:{
};
c:
d
:
e:
_ATEOF
cat >experr <<'_ATEOF'
input.y:11.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
11 | a: <warning>{}</warning>
| <warning>^~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:12.3-13.1: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
12 | b:<warning>{</warning>
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:14.3: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
14 | c:
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:16.2: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
16 | :
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:17.3: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
17 | e:
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:133: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:133"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:133: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:133"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_146
#AT_START_147
at_fn_group_banner 147 'diagnostics.at:182' \
"Line is too short, and then you die" " " 5
at_xfail=no
(
printf "%s\n" "147. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:182" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:182"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
// Beware that there are 9 lines inserted before (including this one).
#line 12
%token foo 123
%token foo 123123
%token foo 123
%%
exp:
_ATEOF
cat >experr <<'_ATEOF'
input.y:13.8-10: <warning>warning:</warning> symbol foo redeclared [<warning>-Wother</warning>]
13 | %token <warning>foo</warning> 123
| <warning>^~~</warning>
input.y:12.8-10: <note>note:</note> previous declaration
12 | %token <note>foo</note> 123123
| <note>^~~</note>
input.y:13.12-17: <error>error:</error> redefining code of token foo
13 | %token foo <error>123</error>
| <error>^~~~~~</error>
input.y:14.8-10: <warning>warning:</warning> symbol foo redeclared [<warning>-Wother</warning>]
14 | %%
| <warning>^~~</warning>
input.y:12.8-10: <note>note:</note> previous declaration
12 | %token <note>foo</note> 123123
| <note>^~~</note>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:182: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:182"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:182: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:182"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_147
#AT_START_148
at_fn_group_banner 148 'diagnostics.at:217' \
"Zero-width characters" " " 5
at_xfail=no
(
printf "%s\n" "148. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:217" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:217"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: an\005error.
_ATEOF
cat >experr <<'_ATEOF'
input.y:10.8: <error>error:</error> invalid character: '\\005'
10 | exp: an<error>\005</error>error.
| <error>^</error>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:217: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:217"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:217: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:217"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:217: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:217"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:217: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:217"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:217"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_148
#AT_START_149
at_fn_group_banner 149 'diagnostics.at:235' \
"Tabulations and multibyte characters" " " 5
at_xfail=no
(
printf "%s\n" "149. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:235" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:235"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: a b c d e f g
a: { }
b: { }
c: {------------}
d: {éééééééééééé}
e: { 42 }
f: { "฿¥$€₦" }
g: { 🐃 }
_ATEOF
cat >experr <<'_ATEOF'
input.y:11.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
11 | a: <warning>{ }</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:12.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
12 | b: <warning>{ }</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:13.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
13 | c: <warning>{------------}</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:14.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
14 | d: <warning>{éééééééééééé}</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:15.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
15 | e: <warning>{ 42 }</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:16.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
16 | f: <warning>{ "฿¥$€₦" }</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:17.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
17 | g: <warning>{ 🐃 }</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:235: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:235"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:235"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:235: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:235"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:235"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:235: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:235"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:235"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:235: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:235"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:235"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_149
#AT_START_150
at_fn_group_banner 150 'diagnostics.at:282' \
"Tabulations and multibyte characters" " " 5
at_xfail=no
(
printf "%s\n" "150. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:282" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:282"
printf "%s\n" "diagnostics.at:282" >"$at_check_line_file"
(uname -a | $EGREP -i 'aix|cygwin') \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:282"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
e: {∇⃗×𝐸⃗ = -∂𝐵⃗/∂t}
_ATEOF
cat >experr <<'_ATEOF'
input.y:10.4-17: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
10 | e: <warning>{∇⃗×𝐸⃗ = -∂𝐵⃗/∂t}</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%empty</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:282: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:282"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:282: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:282"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:282: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:282"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:282: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:282"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:282"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_150
#AT_START_151
at_fn_group_banner 151 'diagnostics.at:303' \
"Special files" " " 5
at_xfail=no
(
printf "%s\n" "151. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:303" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:303"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: a b
a: {}
#line 1 "/dev/stdout"
b: {}
_ATEOF
cat >experr <<'_ATEOF'
input.y:11.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
11 | a: <warning>{}</warning>
| <warning>^~</warning>
| <fixit-insert>%empty</fixit-insert>
/dev/stdout:1.4-5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
| <fixit-insert>%empty</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:303: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:303"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:303"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:303: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:303"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:303"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:303: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:303"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:303"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:303: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:303"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:303"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_151
#AT_START_152
at_fn_group_banner 152 'diagnostics.at:328' \
"Complaints from M4" " " 5
at_xfail=no
(
printf "%s\n" "152. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:328" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:328"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define error1 {e}
%define error2 {é}
%%
exp: %empty;
_ATEOF
cat >experr <<'_ATEOF'
input.y:9.1-27: <error>error:</error> %define variable 'error1' is not used
9 | <error>%define error1 {e}</error>
| <error>^~~~~~~~~~~~~~~~~~~~~~~~~~~</error>
input.y:10.1-27: <error>error:</error> %define variable 'error2' is not used
10 | <error>%define error2 {é}</error>
| <error>^~~~~~~~~~~~~~~~~~~~~~~~~~~</error>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:328: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:328"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:328: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:328"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_152
#AT_START_153
at_fn_group_banner 153 'diagnostics.at:351' \
"Carriage return" " " 5
at_xfail=no
(
printf "%s\n" "153. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:351" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:351"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M^M
%token "
%%
_ATEOF
cat >experr <<'_ATEOF'
input.y:10.8-11.0: <error>error:</error> missing '"' at end of line
10 | %token <error>"</error>
| <error>^</error>
input.y:10.8-11.0: <error>error:</error> expected <expected>character literal</expected> or <expected>identifier</expected> or <expected><tag></expected> before <unexpected>string</unexpected>
10 | %token <error>"</error>
| <error>^</error>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:351: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:351"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:351"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:351: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:351"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:351"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:351: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:351"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:351: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:351"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:351"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_153
#AT_START_154
at_fn_group_banner 154 'diagnostics.at:372' \
"CR NL" " " 5
at_xfail=no
(
printf "%s\n" "154. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:372" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:372"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
^M
%token ^M FOO^M
%token ^M FOO^M
%%^M
exp:^M
_ATEOF
cat >experr <<'_ATEOF'
input.y:11.9-11: <warning>warning:</warning> symbol FOO redeclared [<warning>-Wother</warning>]
11 | %token
<warning>FOO</warning>
| <warning>^~~</warning>
input.y:10.9-11: <note>note:</note> previous declaration
10 | %token
<note>FOO</note>
| <note>^~~</note>
input.y:13.5: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
13 | exp:
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:372: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:372"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:372: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:372"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_154
#AT_START_155
at_fn_group_banner 155 'diagnostics.at:399' \
"Screen width: 200 columns" " " 5
at_xfail=no
(
printf "%s\n" "155. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:399" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:399"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
%error-verbose
%%
exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ
_ATEOF
cat >experr <<'_ATEOF'
input.y:9.36-61: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.64-89: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning> ABCDEFGHIJKLMNOPQRSTUVWXYZ
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.92-117: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning>
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:10.56-69: <warning>warning:</warning> deprecated directive: '%error-verbose', use '%define parse.error verbose' [<warning>-Wdeprecated</warning>]
10 | <warning>%error-verbose</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%define parse.error verbose</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:399: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:399"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:399"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:399: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=200 bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=200 bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:399"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=200 bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:399"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:399: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:399"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:399"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:399: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=200 bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=200 bison -fcaret -Wall,cex input.y" "diagnostics.at:399"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=200 bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:399"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_155
#AT_START_156
at_fn_group_banner 156 'diagnostics.at:432' \
"Screen width: 80 columns" " " 5
at_xfail=no
(
printf "%s\n" "156. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:432" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:432"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
%error-verbose
%%
exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ
_ATEOF
cat >experr <<'_ATEOF'
input.y:9.36-61: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning> ABCDEF...
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.64-89: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEF</warning>...
| <warning>^~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.92-117: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | ...TUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning>
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEF...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:10.56-69: <warning>warning:</warning> deprecated directive: '%error-verbose', use '%define parse.error verbose' [<warning>-Wdeprecated</warning>]
10 | <warning>%error-verbose</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%define parse.error verbose</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:432: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:432"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:432"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=80 bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=80 bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=80 bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:432"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:432: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:432"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=80 bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=80 bison -fcaret -Wall,cex input.y" "diagnostics.at:432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=80 bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:432"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_156
#AT_START_157
at_fn_group_banner 157 'diagnostics.at:465' \
"Screen width: 60 columns" " " 5
at_xfail=no
(
printf "%s\n" "157. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:465" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:465"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ ABCDEFGHIJKLMNOPQRSTUVWXYZ
%error-verbose
%%
exp: ABCDEFGHIJKLMNOPQRSTUVWXYZ
_ATEOF
cat >experr <<'_ATEOF'
input.y:9.36-61: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | %token ABCDEFGHIJKLMNOPQRSTUVWXYZ <warning>ABCDEFGHIJKLMN</warning>...
| <warning>^~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMN...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.64-89: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | ...TUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning> ABCDEFGHI...
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMN...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:9.92-117: <warning>warning:</warning> symbol ABCDEFGHIJKLMNOPQRSTUVWXYZ redeclared [<warning>-Wother</warning>]
9 | ...TUVWXYZ <warning>ABCDEFGHIJKLMNOPQRSTUVWXYZ</warning>
| <warning>^~~~~~~~~~~~~~~~~~~~~~~~~~</warning>
input.y:9.8-33: <note>note:</note> previous declaration
9 | %token <note>ABCDEFGHIJKLMNOPQRSTUVWXYZ</note> ABCDEFGHIJKLMN...
| <note>^~~~~~~~~~~~~~~~~~~~~~~~~~</note>
input.y:10.56-69: <warning>warning:</warning> deprecated directive: '%error-verbose', use '%define parse.error verbose' [<warning>-Wdeprecated</warning>]
10 | ... <warning>%error-verbose</warning>
| <warning>^~~~~~~~~~~~~~</warning>
| <fixit-insert>%define parse.error verbose</fixit-insert>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:465: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:465"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:465: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=60 bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=60 bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:465"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=60 bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:465: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:465"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:465: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" COLUMNS=60 bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" COLUMNS=60 bison -fcaret -Wall,cex input.y" "diagnostics.at:465"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" COLUMNS=60 bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:465"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_157
#AT_START_158
at_fn_group_banner 158 'diagnostics.at:504' \
"Suggestions" " " 5
at_xfail=no
(
printf "%s\n" "158. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:504" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:504"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
res: QUX baz
bar: QUUX
_ATEOF
cat >experr <<'_ATEOF'
input.y:10.6-8: <error>error:</error> symbol 'QUX' is used, but is not defined as a token and has no rules
10 | res: <error>QUX</error> baz
| <error>^~~</error>
input.y:10.10-12: <error>error:</error> symbol 'baz' is used, but is not defined as a token and has no rules; did you mean 'bar'?
10 | res: QUX <error>baz</error>
| <error>^~~</error>
| <fixit-insert>bar</fixit-insert>
input.y:11.6-9: <error>error:</error> symbol 'QUUX' is used, but is not defined as a token and has no rules
11 | bar: <error>QUUX</error>
| <error>^~~~</error>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:504: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:504"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:504"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:504: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:504"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:504"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:504: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:504"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:504"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:504: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:504"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:504"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_158
#AT_START_159
at_fn_group_banner 159 'diagnostics.at:527' \
"Counterexamples" " " 5
at_xfail=no
(
printf "%s\n" "159. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:527" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:527"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%expect 0
%%
exp
: "if" exp "then" exp
| "if" exp "then" exp "else" exp
| exp "+" exp
| "num"
| empty "a"
| "a" empty
empty
: %empty
_ATEOF
cat >experr <<'_ATEOF'
input.y: <error>error:</error> shift/reduce conflicts: 9 found, 0 expected
input.y: <warning>warning:</warning> shift/reduce conflict on token "a" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-dot>•</cex-dot> <cex-leaf>"a"</cex-leaf><cex-1></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 6: <cex-dot>•</cex-dot><cex-leaf> "a"</cex-leaf><cex-1><cex-step> empty</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 6: ε</cex-step></cex-1>
Example: <cex-0><cex-1><cex-dot>•</cex-dot></cex-1> <cex-leaf>"a"</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 5: <cex-1><cex-step>empty</cex-step></cex-1><cex-leaf> "a"</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 7: ε<cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "a" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-dot>•</cex-dot> <cex-leaf>"a"</cex-leaf><cex-1></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 6: <cex-dot>•</cex-dot><cex-leaf> "a"</cex-leaf><cex-1><cex-step> empty</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 6: ε</cex-step></cex-1>
Example: <cex-0><cex-1><cex-dot>•</cex-dot></cex-1> <cex-leaf>"a"</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 5: <cex-1><cex-step>empty</cex-step></cex-1><cex-leaf> "a"</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 7: ε<cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "a" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-dot>•</cex-dot> <cex-leaf>"a"</cex-leaf><cex-1></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 6: <cex-dot>•</cex-dot><cex-leaf> "a"</cex-leaf><cex-1><cex-step> empty</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 6: ε</cex-step></cex-1>
Example: <cex-0><cex-1><cex-dot>•</cex-dot></cex-1> <cex-leaf>"a"</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 5: <cex-1><cex-step>empty</cex-step></cex-1><cex-leaf> "a"</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 7: ε<cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "a" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-dot>•</cex-dot> <cex-leaf>"a"</cex-leaf><cex-1></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 6: <cex-dot>•</cex-dot><cex-leaf> "a"</cex-leaf><cex-1><cex-step> empty</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 6: ε</cex-step></cex-1>
Example: <cex-0><cex-1><cex-dot>•</cex-dot></cex-1> <cex-leaf>"a"</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 5: <cex-1><cex-step>empty</cex-step></cex-1><cex-leaf> "a"</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 7: ε<cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 3: <cex-leaf>exp</cex-leaf><cex-leaf> "+"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 3: <cex-leaf>exp</cex-leaf><cex-dot> •</cex-dot><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-1>
Example: <cex-0><cex-1><cex-leaf>exp</cex-leaf> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 3: <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 3: <cex-leaf>exp</cex-leaf><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "else" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 1: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 2: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot><cex-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-1>
Example: <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 2: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1><cex-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 1: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 1: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 3: <cex-leaf>exp</cex-leaf><cex-dot> •</cex-dot><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-1>
Example: <cex-0><cex-1><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 3: <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 1: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "a" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-dot>•</cex-dot> <cex-leaf>"a"</cex-leaf><cex-1></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 6: <cex-dot>•</cex-dot><cex-leaf> "a"</cex-leaf><cex-1><cex-step> empty</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 6: ε</cex-step></cex-1>
Example: <cex-0><cex-1><cex-dot>•</cex-dot></cex-1> <cex-leaf>"a"</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 5: <cex-1><cex-step>empty</cex-step></cex-1><cex-leaf> "a"</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 7: ε<cex-dot> •</cex-dot></cex-step></cex-1>
input.y: <warning>warning:</warning> shift/reduce conflict on token "+" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"else"</cex-leaf><cex-1> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-1></cex-0>
Shift derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 2: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "else"</cex-leaf><cex-1><cex-step> exp</cex-step></cex-1></cex-step></cex-0>
<cex-1><cex-step> ↳ 3: <cex-leaf>exp</cex-leaf><cex-dot> •</cex-dot><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-1>
Example: <cex-0><cex-1><cex-leaf>"if"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"then"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-leaf>"else"</cex-leaf> <cex-leaf>exp</cex-leaf> <cex-dot>•</cex-dot></cex-1> <cex-leaf>"+"</cex-leaf> <cex-leaf>exp</cex-leaf></cex-0>
Reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 3: <cex-1><cex-step>exp</cex-step></cex-1><cex-leaf> "+"</cex-leaf><cex-leaf> exp</cex-leaf></cex-step></cex-0>
<cex-1><cex-step> ↳ 2: <cex-leaf>"if"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "then"</cex-leaf><cex-leaf> exp</cex-leaf><cex-leaf> "else"</cex-leaf><cex-leaf> exp</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-1>
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:527: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:527"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:527: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:527"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:527: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:527"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:527: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:527"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:527"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_159
#AT_START_160
at_fn_group_banner 160 'diagnostics.at:645' \
"Deep Counterexamples" " " 5
at_xfail=no
(
printf "%s\n" "160. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "diagnostics.at:645" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/diagnostics.at:645"
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%expect 0
%%
exp: x1 e1 foo1 x1 | y1 e2 bar1 y1
foo1: foo2
foo2: foo3
foo3: x1 foo4
foo4: "quuux"
bar1: bar2
bar2: bar3
bar3: y1 bar4
bar4: "quuux"
x1: x2
x2: x3
x3: "X"
y1: y2
y2: y3
y3: "X"
e1:
e2:
_ATEOF
cat >experr <<'_ATEOF'
input.y:30.4: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
30 | e1:
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y:31.4: <warning>warning:</warning> empty rule without %empty [<warning>-Wempty-rule</warning>]
31 | e2:
| <warning>^</warning>
| <fixit-insert>%empty</fixit-insert>
input.y: <error>error:</error> reduce/reduce conflicts: 1 found, 0 expected
input.y: <warning>warning:</warning> reduce/reduce conflict on token "X" [<warning>-Wcounterexamples</warning>]
Example: <cex-0><cex-1><cex-2><cex-3><cex-leaf>"X"</cex-leaf> <cex-dot>•</cex-dot></cex-3></cex-2></cex-1><cex-4></cex-4><cex-5><cex-6><cex-7><cex-8><cex-9><cex-10> <cex-leaf>"X"</cex-leaf></cex-10></cex-9></cex-8><cex-11> <cex-leaf>"quuux"</cex-leaf></cex-11></cex-7></cex-6></cex-5><cex-12><cex-13><cex-14> <cex-leaf>"X"</cex-leaf></cex-14></cex-13></cex-12></cex-0>
First reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 1: <cex-1><cex-step>x1</cex-step></cex-1><cex-4><cex-step> e1</cex-step></cex-4><cex-5><cex-step> foo1</cex-step></cex-5><cex-12><cex-step> x1</cex-step></cex-12></cex-step></cex-0>
<cex-1><cex-step> ↳ 11: <cex-2><cex-step>x2</cex-step></cex-2></cex-step></cex-1><cex-4><cex-step> ↳ 1: ε</cex-step></cex-4><cex-5><cex-step> ↳ 3: <cex-6><cex-step>foo2</cex-step></cex-6></cex-step></cex-5><cex-12><cex-step> ↳ 11: <cex-13><cex-step>x2</cex-step></cex-13></cex-step></cex-12>
<cex-2><cex-step> ↳ 12: <cex-3><cex-step>x3</cex-step></cex-3></cex-step></cex-2><cex-6><cex-step> ↳ 4: <cex-7><cex-step>foo3</cex-step></cex-7></cex-step></cex-6><cex-13><cex-step> ↳ 12: <cex-14><cex-step>x3</cex-step></cex-14></cex-step></cex-13>
<cex-3><cex-step> ↳ 13: <cex-leaf>"X"</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-3><cex-7><cex-step> ↳ 5: <cex-8><cex-step>x1</cex-step></cex-8><cex-11><cex-step> foo4</cex-step></cex-11></cex-step></cex-7><cex-14><cex-step> ↳ 13: <cex-leaf>"X"</cex-leaf></cex-step></cex-14>
<cex-8><cex-step> ↳ 11: <cex-9><cex-step>x2</cex-step></cex-9></cex-step></cex-8><cex-11><cex-step> ↳ 6: <cex-leaf>"quuux"</cex-leaf></cex-step></cex-11>
<cex-9><cex-step> ↳ 12: <cex-10><cex-step>x3</cex-step></cex-10></cex-step></cex-9>
<cex-10><cex-step> ↳ 13: <cex-leaf>"X"</cex-leaf></cex-step></cex-10>
Example: <cex-0><cex-1><cex-2><cex-3><cex-leaf>"X"</cex-leaf> <cex-dot>•</cex-dot></cex-3></cex-2></cex-1><cex-4></cex-4><cex-5><cex-6><cex-7><cex-8><cex-9><cex-10> <cex-leaf>"X"</cex-leaf></cex-10></cex-9></cex-8><cex-11> <cex-leaf>"quuux"</cex-leaf></cex-11></cex-7></cex-6></cex-5><cex-12><cex-13><cex-14> <cex-leaf>"X"</cex-leaf></cex-14></cex-13></cex-12></cex-0>
Second reduce derivation
<cex-0><cex-step>exp</cex-step></cex-0>
<cex-0><cex-step>↳ 2: <cex-1><cex-step>y1</cex-step></cex-1><cex-4><cex-step> e2</cex-step></cex-4><cex-5><cex-step> bar1</cex-step></cex-5><cex-12><cex-step> y1</cex-step></cex-12></cex-step></cex-0>
<cex-1><cex-step> ↳ 14: <cex-2><cex-step>y2</cex-step></cex-2></cex-step></cex-1><cex-4><cex-step> ↳ 2: ε</cex-step></cex-4><cex-5><cex-step> ↳ 7: <cex-6><cex-step>bar2</cex-step></cex-6></cex-step></cex-5><cex-12><cex-step> ↳ 14: <cex-13><cex-step>y2</cex-step></cex-13></cex-step></cex-12>
<cex-2><cex-step> ↳ 15: <cex-3><cex-step>y3</cex-step></cex-3></cex-step></cex-2><cex-6><cex-step> ↳ 8: <cex-7><cex-step>bar3</cex-step></cex-7></cex-step></cex-6><cex-13><cex-step> ↳ 15: <cex-14><cex-step>y3</cex-step></cex-14></cex-step></cex-13>
<cex-3><cex-step> ↳ 16: <cex-leaf>"X"</cex-leaf><cex-dot> •</cex-dot></cex-step></cex-3><cex-7><cex-step> ↳ 9: <cex-8><cex-step>y1</cex-step></cex-8><cex-11><cex-step> bar4</cex-step></cex-11></cex-step></cex-7><cex-14><cex-step> ↳ 16: <cex-leaf>"X"</cex-leaf></cex-step></cex-14>
<cex-8><cex-step> ↳ 14: <cex-9><cex-step>y2</cex-step></cex-9></cex-step></cex-8><cex-11><cex-step> ↳ 10: <cex-leaf>"quuux"</cex-leaf></cex-step></cex-11>
<cex-9><cex-step> ↳ 15: <cex-10><cex-step>y3</cex-step></cex-10></cex-step></cex-9>
<cex-10><cex-step> ↳ 16: <cex-leaf>"X"</cex-leaf></cex-step></cex-10>
input.y: <warning>warning:</warning> fix-its can be applied. Rerun with option '--update'. [<warning>-Wother</warning>]
_ATEOF
# For some reason, literal ^M in the input are removed and don't end
# in `input.y`. So use the two-character ^M represent it, and let
# Perl insert real CR characters.
if $EGREP '\^M|\\[0-9][0-9][0-9]' input.y experr >/dev/null; then
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:645: \"\$PERL\" -pi -e 's{\\^M}{\\r}g;s{\\\\(\\d{3}|.)}{\$v = \$1; \$v =~ /\\A\\d+\\z/ ? chr(\$v) : \$v}ge' input.y experr || exit 77"
at_fn_check_prepare_notrace 'a shell pipeline' "diagnostics.at:645"
( $at_check_trace; "$PERL" -pi -e 's{\^M}{\r}g;s{\\(\d{3}|.)}{$v = $1; $v =~ /\A\d+\z/ ? chr($v) : $v}ge' input.y experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:645: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret --color=debug -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret --color=debug -Wall,cex input.y" "diagnostics.at:645"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret --color=debug -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }
# When no style, same messages, but without style.
# Except for the second display of the counterexample,
# which is not displayed at all.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:645: \"\$PERL\" -pi -e '
s{(</?(-|\\w)+>)}{ \$1 eq \"<tag>\" ? \$1 : \"\" }ge;
if (/Example/)
{
++\$example;
\$_ = \"\" if \$example % 2 == 0;
}
' experr || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:645"
( $at_check_trace; "$PERL" -pi -e '
s{(</?(-|\w)+>)}{ $1 eq "<tag>" ? $1 : "" }ge;
if (/Example/)
{
++$example;
$_ = "" if $example % 2 == 0;
}
' experr || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }
# Cannot use AT_BISON_CHECK easily as we need to change the
# environment.
# FIXME: Enhance AT_BISON_CHECK.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:645: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"\$locale\" bison -fcaret -Wall,cex input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; LC_ALL=\"$locale\" bison -fcaret -Wall,cex input.y" "diagnostics.at:645"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; LC_ALL="$locale" bison -fcaret -Wall,cex input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:645"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_160
#AT_START_161
at_fn_group_banner 161 'diagnostics.at:713' \
"Indentation with message suppression" " " 5
at_xfail=no
(
printf "%s\n" "161. $at_setup_line: testing $at_desc ..."
$at_traceon
# https://lists.gnu.org/r/bug-bison/2019-08/msg00002.html
cat >input.y <<'_ATEOF'
%define api.pure
%pure-parser
%error-verbose
%%
exp : '0'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wno-other input.y"
at_fn_check_prepare_notrace 'an embedded newline' "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y" "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "diagnostics.at:725"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "diagnostics.at:725"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "diagnostics.at:725"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wno-other input.y"
at_fn_check_prepare_trace "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wno-other input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
2 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
input.y:3.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
3 | %error-verbose
| ^~~~~~~~~~~~~~
| %define parse.error verbose
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Werror" "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.1-12: warning: deprecated directive: '%pure-parser', use '%define api.pure' [-Wdeprecated]
2 | %pure-parser
| ^~~~~~~~~~~~
| %define api.pure
input.y:3.1-14: warning: deprecated directive: '%error-verbose', use '%define parse.error verbose' [-Wdeprecated]
3 | %error-verbose
| ^~~~~~~~~~~~~~
| %define parse.error verbose
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "diagnostics.at:725"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=error" "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none" "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/diagnostics.at:725: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none" "diagnostics.at:725"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wno-other input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/diagnostics.at:725"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_161
#AT_START_162
at_fn_group_banner 162 'skeletons.at:25' \
"Relative skeleton file names" " " 6
at_xfail=no
(
printf "%s\n" "162. $at_setup_line: testing $at_desc ..."
$at_traceon
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:27: mkdir tmp"
at_fn_check_prepare_trace "skeletons.at:27"
( $at_check_trace; mkdir tmp
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:27"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >tmp/skel.c <<'_ATEOF'
m4_divert_push(0)dnl
@output(b4_parser_file_name@)dnl
b4_percent_define_get([[test]])
m4_divert_pop(0)
_ATEOF
cat >skel.c <<'_ATEOF'
m4_divert_push(0)dnl
@output(b4_parser_file_name@)dnl
b4_percent_define_get([[test]]) -- Local
m4_divert_pop(0)
_ATEOF
cat >tmp/input-gram.y <<'_ATEOF'
%skeleton "./skel.c"
%define test "Hello World"
%%
start: ;
_ATEOF
cat >input-gram.y <<'_ATEOF'
%skeleton "./skel.c"
%define test "Hello World"
%%
start: ;
_ATEOF
cat >tmp/input-cmd-line.y <<'_ATEOF'
%define test "Hello World"
%%
start: ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv tmp/input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:63"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y" "skeletons.at:63"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:63"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "skeletons.at:63"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:63"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:63: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret tmp/input-gram.y"
at_fn_check_prepare_trace "skeletons.at:63"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret tmp/input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:63"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:64: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:64"
( $at_check_trace; cat input-gram.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Hello World
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:64"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y" "skeletons.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:68"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "skeletons.at:68"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:68"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:68: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input-gram.y"
at_fn_check_prepare_trace "skeletons.at:68"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:68"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:69: cat input-gram.tab.c"
at_fn_check_prepare_trace "skeletons.at:69"
( $at_check_trace; cat input-gram.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Hello World -- Local
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:69"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:73"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y" "skeletons.at:73"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:73"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "skeletons.at:73"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:73"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:73: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --skeleton=tmp/skel.c tmp/input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:73"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --skeleton=tmp/skel.c tmp/input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:73"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:74: cat input-cmd-line.tab.c"
at_fn_check_prepare_trace "skeletons.at:74"
( $at_check_trace; cat input-cmd-line.tab.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Hello World
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:74"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_162
#AT_START_163
at_fn_group_banner 163 'skeletons.at:85' \
"Installed skeleton file names" " " 6
at_xfail=no
(
printf "%s\n" "163. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input-cmd-line.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
%}
%define parse.error verbose
%token 'a'
%%
start: ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
int
yylex (void)
{
return 'a';
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
cat >input-gram.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c"
%{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
%}
%define parse.error verbose
%token 'a'
%%
start: ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
int
yylex (void)
{
return 'a';
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:120"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y" "skeletons.at:120"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:120"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "skeletons.at:120"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:120"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:120: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y"
at_fn_check_prepare_trace "skeletons.at:120"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --skeleton=yacc.c -o input-cmd-line.c input-cmd-line.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:120"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "skeletons.at:121" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/skeletons.at:121"
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:121: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-cmd-line input-cmd-line.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS" "skeletons.at:121"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-cmd-line input-cmd-line.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:121"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:122: \$PREPARSER ./input-cmd-line"
at_fn_check_prepare_dynamic " $PREPARSER ./input-cmd-line" "skeletons.at:122"
( $at_check_trace; $PREPARSER ./input-cmd-line
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:122"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:122: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "skeletons.at:122"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'a', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:122"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input-gram.c input-gram.y"
at_fn_check_prepare_notrace 'an embedded newline' "skeletons.at:126"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y" "skeletons.at:126"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:126"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "skeletons.at:126"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "skeletons.at:126"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:126: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input-gram.c input-gram.y"
at_fn_check_prepare_trace "skeletons.at:126"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input-gram.c input-gram.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:126"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "skeletons.at:127" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/skeletons.at:127"
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:127: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input-gram input-gram.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS" "skeletons.at:127"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input-gram input-gram.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:128: \$PREPARSER ./input-gram"
at_fn_check_prepare_dynamic " $PREPARSER ./input-gram" "skeletons.at:128"
( $at_check_trace; $PREPARSER ./input-gram
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:128: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "skeletons.at:128"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'a', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:128"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_163
#AT_START_164
at_fn_group_banner 164 'skeletons.at:142' \
"Boolean=variables: invalid skeleton defaults" " " 6
at_xfail=no
(
printf "%s\n" "164. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >skel.c <<'_ATEOF'
b4_percent_define_default([[foo]], [[bogus value]])
b4_percent_define_flag_if([[foo]])
_ATEOF
cat >input.y <<'_ATEOF'
%skeleton "./skel.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:155: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "skeletons.at:155"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "<skeleton default value>: error: invalid value for %define Boolean variable 'foo'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:155"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_164
#AT_START_165
at_fn_group_banner 165 'skeletons.at:166' \
"Complaining during macro argument expansion" " " 6
at_xfail=no
(
printf "%s\n" "165. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >skel1.c <<'_ATEOF'
m4_define([foow], [b4_warn([[foow fubar]])])
m4_define([foowat], [b4_warn_at([[foow.y:2.3]],
[[foow.y:5.4]], [[foowat fubar]])])
m4_define([fooc], [b4_complain([[fooc fubar]])])
m4_define([foocat], [b4_complain_at([[fooc.y:1.1]],
[[fooc.y:10.6]], [[foocat fubar]])])
m4_define([foof], [b4_fatal([[foof fubar]])])
m4_if(foow, [1], [yes])
m4_if(foowat, [1], [yes])
m4_if(fooc, [1], [yes])
m4_if(foocat, [1], [yes])
m4_if(foof, [1], [yes])
_ATEOF
cat >input1.y <<'_ATEOF'
%skeleton "./skel1.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:189: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" "skeletons.at:189"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input1.y: warning: foow fubar [-Wother]
foow.y:2.3-5.3: warning: foowat fubar [-Wother]
input1.y: error: fooc fubar
fooc.y:1.1-10.5: error: foocat fubar
input1.y: fatal error: foof fubar
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >skel2.c <<'_ATEOF'
m4_define([foofat], [b4_fatal_at([[foof.y:12.11]],
[[foof.y:100.123]], [[foofat fubar]])])
m4_if(foofat, [1], [yes])
_ATEOF
cat >input2.y <<'_ATEOF'
%skeleton "./skel2.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:209: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" "skeletons.at:209"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "foof.y:12.11-100.122: fatal error: foofat fubar
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:209"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >skel3.c <<'_ATEOF'
b4_complain_at(b4_percent_define_get_loc([[bogus]]), [[bad value]])
_ATEOF
cat >input3.y <<'_ATEOF'
%skeleton "./skel3.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:223: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y" "skeletons.at:223"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input3.y: fatal error: b4_percent_define_get_loc: undefined %define variable 'bogus'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:223"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >skel4.c <<'_ATEOF'
b4_warn_at(b4_percent_define_get_syncline([[bogus]]), [[bad value]])
_ATEOF
cat >input4.y <<'_ATEOF'
%skeleton "./skel4.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:237: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y" "skeletons.at:237"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input4.y: fatal error: b4_percent_define_get_syncline: undefined %define variable 'bogus'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:237"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_165
#AT_START_166
at_fn_group_banner 166 'skeletons.at:248' \
"Fatal errors make M4 exit immediately" " " 6
at_xfail=no
(
printf "%s\n" "166. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >skel1.c <<'_ATEOF'
b4_complain([[non-fatal error]])
b4_fatal([[M4 should exit immediately here]])
m4_fatal([this should never be evaluated])
_ATEOF
cat >input1.y <<'_ATEOF'
%skeleton "./skel1.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:262: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y" "skeletons.at:262"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input1.y: error: non-fatal error
input1.y: fatal error: M4 should exit immediately here
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:262"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >skel2.c <<'_ATEOF'
b4_warn([[morning]])
b4_fatal_at([[foo.y:1.5]], [[foo.y:1.7]], [[M4 should exit immediately here]])
m4_fatal([this should never be evaluated])
_ATEOF
cat >input2.y <<'_ATEOF'
%skeleton "./skel2.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:279: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y" "skeletons.at:279"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input2.y: warning: morning [-Wother]
foo.y:1.5-6: fatal error: M4 should exit immediately here
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:279"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_166
#AT_START_167
at_fn_group_banner 167 'skeletons.at:302' \
"Fatal errors but M4 continues producing output" " " 6
at_xfail=no
(
printf "%s\n" "167. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >gen-skel.pl <<'_ATEOF'
use warnings;
use strict;
my $M4 = "m4";
my $DNL = "d"."nl";
print "${M4}_divert_push(0)$DNL\n";
print '@output(@,@,@)', "\n";
(print "garbage"x10, "\n") for (1..1000);
print "${M4}_divert_pop(0)\n";
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:314: \"\$PERL\" gen-skel.pl > skel.c || exit 77"
at_fn_check_prepare_dynamic "\"$PERL\" gen-skel.pl > skel.c || exit 77" "skeletons.at:314"
( $at_check_trace; "$PERL" gen-skel.pl > skel.c || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/skeletons.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%skeleton "./skel.c"
%%
start: ;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/skeletons.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "skeletons.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: fatal error: too many arguments for @output directive in skeleton
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/skeletons.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_167
#AT_START_168
at_fn_group_banner 168 'sets.at:27' \
"Nullable" " " 7
at_xfail=no
(
printf "%s\n" "168. $at_setup_line: testing $at_desc ..."
$at_traceon
# At some point, nullable had been smoking grass, and managed to say:
#
# Entering set_nullable
# NULLABLE
# 'e': yes
# (null): no
# ...
cat >input.y <<'_ATEOF'
%%
e: 'e' | /* Nothing */;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:42"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:42"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:42"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:42"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:42"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:42: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:42"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:42"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >extract.sed <<'_ATEOF'
#n
/^DERIVES/ {
:DERIVES
p
n
/^ *$/ !b DERIVES
}
/^NULLABLE/ {
:NULLABL
p
n
/^ *$/ !b NULLABL
}
/^FIRSTS/ {
:FIRSTS
p
n
/^ *$/ !b FIRSTS
}
/^FDERIVES/ {
:FDERIVE
p
n
/^ *$/ !b FDERIVE
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/sets.at:43: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:43"
( $at_check_trace; sed -f extract.sed stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "DERIVES
\$accept derives
0 e \$end
e derives
1 'e'
2 %empty
NULLABLE
\$accept: no
e: yes
FIRSTS
\$accept firsts
\$accept
e
e firsts
e
FDERIVES
\$accept derives
0 e \$end
1 'e'
2 %empty
e derives
1 'e'
2 %empty
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:43"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_168
#AT_START_169
at_fn_group_banner 169 'sets.at:111' \
"Broken Closure" " " 7
at_xfail=no
(
printf "%s\n" "169. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
a: b;
b: c;
c: d;
d: e;
e: f;
f: g;
g: h;
h: 'h';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:125"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:125"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:125"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:125: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:125"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:125"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:127: sed -n 's/[ ]*\$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr"
at_fn_check_prepare_dynamic "sed -n 's/[ ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr" "sets.at:127"
( $at_check_trace; sed -n 's/[ ]*$//;/^RTC: Firsts Output BEGIN/,/^RTC: Firsts Output END/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "RTC: Firsts Output BEGIN
012345678
.---------.
0|111111111|
1| 11111111|
2| 1111111|
3| 111111|
4| 11111|
5| 1111|
6| 111|
7| 11|
8| 1|
\`---------'
RTC: Firsts Output END
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:127"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_169
#AT_START_170
at_fn_group_banner 170 'sets.at:153' \
"Firsts" " " 7
at_xfail=no
(
printf "%s\n" "170. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%nonassoc '<' '>'
%left '+' '-'
%right '^' '='
%%
exp:
exp '<' exp
| exp '>' exp
| exp '+' exp
| exp '-' exp
| exp '^' exp
| exp '=' exp
| "exp"
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=sets input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:171"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y" "sets.at:171"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:171"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:171"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:171"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:171: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y"
at_fn_check_prepare_trace "sets.at:171"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=sets input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:171"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >extract.sed <<'_ATEOF'
#n
/^DERIVES/ {
:DERIVES
p
n
/^ *$/ !b DERIVES
}
/^NULLABLE/ {
:NULLABL
p
n
/^ *$/ !b NULLABL
}
/^FIRSTS/ {
:FIRSTS
p
n
/^ *$/ !b FIRSTS
}
/^FDERIVES/ {
:FDERIVE
p
n
/^ *$/ !b FDERIVE
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/sets.at:172: sed -f extract.sed stderr"
at_fn_check_prepare_trace "sets.at:172"
( $at_check_trace; sed -f extract.sed stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "DERIVES
\$accept derives
0 exp \$end
exp derives
1 exp '<' exp
2 exp '>' exp
3 exp '+' exp
4 exp '-' exp
5 exp '^' exp
6 exp '=' exp
7 \"exp\"
NULLABLE
\$accept: no
exp: no
FIRSTS
\$accept firsts
\$accept
exp
exp firsts
exp
FDERIVES
\$accept derives
0 exp \$end
1 exp '<' exp
2 exp '>' exp
3 exp '+' exp
4 exp '-' exp
5 exp '^' exp
6 exp '=' exp
7 \"exp\"
exp derives
1 exp '<' exp
2 exp '>' exp
3 exp '+' exp
4 exp '-' exp
5 exp '^' exp
6 exp '=' exp
7 \"exp\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:172"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_170
#AT_START_171
at_fn_group_banner 171 'sets.at:228' \
"Accept" " " 7
at_xfail=no
(
printf "%s\n" "171. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token END 0
%%
input:
'a'
| '(' input ')'
| '(' error END
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:240"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y" "sets.at:240"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:240"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:240"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:240"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:240: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v -o input.c input.y"
at_fn_check_prepare_trace "sets.at:240"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:240"
$at_failed && at_fn_log_failure
$at_traceon; }
# Get the final state in the parser.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:243: sed -n 's/.*define YYFINAL *\\([0-9][0-9]*\\)/final state \\1/p' input.c"
at_fn_check_prepare_trace "sets.at:243"
( $at_check_trace; sed -n 's/.*define YYFINAL *\([0-9][0-9]*\)/final state \1/p' input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:243"
$at_failed && at_fn_log_failure
$at_traceon; }
mv stdout expout
# Get the final state in the report, from the "accept" action..
{ set +x
printf "%s\n" "$at_srcdir/sets.at:248: sed -n '
/^State \\(.*\\)/{
s//final state \\1/
x
}
/ accept/{
x
p
q
}
' input.output"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:248"
( $at_check_trace; sed -n '
/^State \(.*\)/{
s//final state \1/
x
}
/ accept/{
x
p
q
}
' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_171
#AT_START_172
at_fn_group_banner 172 'sets.at:269' \
"Build relations" " " 7
at_xfail=no
(
printf "%s\n" "172. $at_setup_line: testing $at_desc ..."
$at_traceon
# The "includes" relation [DeRemer 1982] is between gotos, so of
# course, for a given goto, there cannot be more that ngotos (number
# of gotos) images. But we manipulate the set of images of a goto as
# a list, without checking that an image was not already introduced.
# So we can "register" way more images than ngotos, leading to a crash
# (heap buffer overflow).
#
# https://lists.gnu.org/r/bug-bison/2019-03/msg00007.html
cat >input.y <<'_ATEOF'
%%
expr: term | term | term | term | term | term
term: 'n'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:286"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:286"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:286"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:2.14-17: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.21-24: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.28-31: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.35-38: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.42-45: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 5 reduce/reduce conflicts [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:2.14-17: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.21-24: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.28-31: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.35-38: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
input.y:2.42-45: warning: rule useless in parser due to conflicts [-Wother]
2 | expr: term | term | term | term | term | term
| ^~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "sets.at:286"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:286: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "sets.at:286"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_172
#AT_START_173
at_fn_group_banner 173 'sets.at:315' \
"Reduced Grammar" " " 7
at_xfail=no
(
printf "%s\n" "173. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
expr: expr "+" term | term
term: term "*" fact | fact
useless: "useless"
fact: "num"
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=grammar -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:325"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:325"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:325"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=grammar -o input.c input.y"
at_fn_check_prepare_trace "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "bison (GNU Bison) 3.8.2
input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 1 rule useless in grammar [-Wother]
input.y:4.1-7: warning: nonterminal useless in grammar: useless [-Wother]
Reduced Grammar
ntokens = 7, nnterms = 4, nsyms = 11, nrules = 6, nritems = 17
Tokens
------
Value Sprec Sassoc Tag
0 0 0 \$end
1 0 0 error
2 0 0 \$undefined
3 0 0 \"+\"
4 0 0 \"*\"
5 0 0 \"useless\"
6 0 0 \"num\"
Nonterminals
------------
Value Tag
7 \$accept
8 expr
9 term
10 fact
Rules
-----
Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs
0 ( 0, 0, t, f) 7 -> ( 0- 1) 8 0
1 ( 0, 0, t, f) 8 -> ( 3- 5) 8 3 9
2 ( 0, 0, t, t) 8 -> ( 7- 7) 9
3 ( 0, 0, t, f) 9 -> ( 9-11) 9 4 10
4 ( 0, 0, t, t) 9 -> (13-13) 10
5 ( 0, 0, t, t) 10 -> (17-17) 6
6 ( 0, 0, f, t) 11 -> (15-15) 5
Rules interpreted
-----------------
0 \$accept: expr \$end
1 expr: expr \"+\" term
2 expr: term
3 term: term \"*\" fact
4 term: fact
5 fact: \"num\"
6 useless: \"useless\"
reduced input.y defines 7 terminals, 4 nonterminals, and 6 productions.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Werror" "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
bison (GNU Bison) 3.8.2
input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 1 rule useless in grammar [-Wother]
input.y:4.1-7: warning: nonterminal useless in grammar: useless [-Wother]
Reduced Grammar
ntokens = 7, nnterms = 4, nsyms = 11, nrules = 6, nritems = 17
Tokens
------
Value Sprec Sassoc Tag
0 0 0 $end
1 0 0 error
2 0 0 $undefined
3 0 0 "+"
4 0 0 "*"
5 0 0 "useless"
6 0 0 "num"
Nonterminals
------------
Value Tag
7 $accept
8 expr
9 term
10 fact
Rules
-----
Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs
0 ( 0, 0, t, f) 7 -> ( 0- 1) 8 0
1 ( 0, 0, t, f) 8 -> ( 3- 5) 8 3 9
2 ( 0, 0, t, t) 8 -> ( 7- 7) 9
3 ( 0, 0, t, f) 9 -> ( 9-11) 9 4 10
4 ( 0, 0, t, t) 9 -> (13-13) 10
5 ( 0, 0, t, t) 10 -> (17-17) 6
6 ( 0, 0, f, t) 11 -> (15-15) 5
Rules interpreted
-----------------
0 $accept: expr $end
1 expr: expr "+" term
2 expr: term
3 term: term "*" fact
4 term: fact
5 fact: "num"
6 useless: "useless"
reduced input.y defines 7 terminals, 4 nonterminals, and 6 productions.
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "sets.at:325"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=error" "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none" "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none" "sets.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=grammar -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_173
#AT_START_174
at_fn_group_banner 174 'sets.at:394' \
"Reduced Grammar with prec and assoc" " " 7
at_xfail=no
(
printf "%s\n" "174. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%nonassoc '<' '>'
%left '+' '-'
%right '^' '='
%%
exp:
exp '<' exp
| exp '>' exp
| exp '+' exp
| exp '-' exp
| exp '^' exp
| exp '=' exp
| "exp"
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=grammar -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "sets.at:412"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y" "sets.at:412"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:412"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "sets.at:412"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "sets.at:412"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/sets.at:412: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=grammar -o input.c input.y"
at_fn_check_prepare_trace "sets.at:412"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=grammar -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "bison (GNU Bison) 3.8.2
Reduced Grammar
ntokens = 10, nnterms = 2, nsyms = 12, nrules = 8, nritems = 29
Tokens
------
Value Sprec Sassoc Tag
0 0 0 \$end
1 0 0 error
2 0 0 \$undefined
3 1 3 '<'
4 1 3 '>'
5 2 2 '+'
6 2 2 '-'
7 3 1 '^'
8 3 1 '='
9 0 0 \"exp\"
Nonterminals
------------
Value Tag
10 \$accept
11 exp
Rules
-----
Num (Prec, Assoc, Useful, UselessChain) Lhs -> (Ritem Range) Rhs
0 ( 0, 0, t, f) 10 -> ( 0- 1) 11 0
1 ( 1, 3, t, f) 11 -> ( 3- 5) 11 3 11
2 ( 1, 3, t, f) 11 -> ( 7- 9) 11 4 11
3 ( 2, 2, t, f) 11 -> (11-13) 11 5 11
4 ( 2, 2, t, f) 11 -> (15-17) 11 6 11
5 ( 3, 1, t, f) 11 -> (19-21) 11 7 11
6 ( 3, 1, t, f) 11 -> (23-25) 11 8 11
7 ( 0, 0, t, t) 11 -> (27-27) 9
Rules interpreted
-----------------
0 \$accept: exp \$end
1 exp: exp '<' exp
2 exp: exp '>' exp
3 exp: exp '+' exp
4 exp: exp '-' exp
5 exp: exp '^' exp
6 exp: exp '=' exp
7 exp: \"exp\"
reduced input.y defines 10 terminals, 2 nonterminals, and 8 productions.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/sets.at:412"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_174
#AT_START_175
at_fn_group_banner 175 'reduce.at:26' \
"Useless Terminals" " " 8
at_xfail=no
(
printf "%s\n" "175. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%verbose
%output "input.c"
%token useless1
%token useless2
%token useless3
%token useless4
%token useless5
%token useless6
%token useless7
%token useless8
%token useless9
%token useful
%%
exp: useful;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:47"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:47"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:47"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:47"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:47"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:47: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "reduce.at:47"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:47"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:49: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:49"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Terminals unused in grammar
useless1
useless2
useless3
useless4
useless5
useless6
useless7
useless8
useless9
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:49"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_175
#AT_START_176
at_fn_group_banner 176 'reduce.at:70' \
"Useless Nonterminals" " " 8
at_xfail=no
(
printf "%s\n" "176. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%verbose
%output "input.c"
%token useful
%%
exp: useful;
useless1:
useless2:
useless3:
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y" "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:89"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:89"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:89"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_trace "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 3 nonterminals useless in grammar [-Wother]
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:11.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
input.y:12.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
input.y:13.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror" "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 3 nonterminals useless in grammar [-Wother]
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:11.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
input.y:12.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
input.y:13.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:89"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error" "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none" "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:89: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none" "reduce.at:89"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:89"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:97: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:97"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Nonterminals useless in grammar
useless1
useless2
useless3
Rules useless in grammar
2 useless1: %empty
3 useless2: %empty
4 useless3: %empty
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:97"
$at_failed && at_fn_log_failure
$at_traceon; }
# Make sure the generated parser is correct.
printf "%s\n" "reduce.at:109" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:109"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:109: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:109"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_176
#AT_START_177
at_fn_group_banner 177 'reduce.at:120' \
"Useless Rules" " " 8
at_xfail=no
(
printf "%s\n" "177. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%verbose
%output "input.c"
%token useful
%%
exp: useful;
useless1: '1';
useless2: '2';
useless3: '3';
useless4: '4';
useless5: '5';
useless6: '6';
useless7: '7';
useless8: '8';
useless9: '9';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:146"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:146"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:146"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 9 nonterminals useless in grammar [-Wother]
input.y: warning: 9 rules useless in grammar [-Wother]
input.y:10.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
10 | useless1: '1';
| ^~~~~~~~
input.y:11.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
11 | useless2: '2';
| ^~~~~~~~
input.y:12.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
12 | useless3: '3';
| ^~~~~~~~
input.y:13.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
13 | useless4: '4';
| ^~~~~~~~
input.y:14.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
14 | useless5: '5';
| ^~~~~~~~
input.y:15.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
15 | useless6: '6';
| ^~~~~~~~
input.y:16.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
16 | useless7: '7';
| ^~~~~~~~
input.y:17.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
17 | useless8: '8';
| ^~~~~~~~
input.y:18.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
18 | useless9: '9';
| ^~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 9 nonterminals useless in grammar [-Wother]
input.y: warning: 9 rules useless in grammar [-Wother]
input.y:10.1-8: warning: nonterminal useless in grammar: useless1 [-Wother]
10 | useless1: '1';
| ^~~~~~~~
input.y:11.1-8: warning: nonterminal useless in grammar: useless2 [-Wother]
11 | useless2: '2';
| ^~~~~~~~
input.y:12.1-8: warning: nonterminal useless in grammar: useless3 [-Wother]
12 | useless3: '3';
| ^~~~~~~~
input.y:13.1-8: warning: nonterminal useless in grammar: useless4 [-Wother]
13 | useless4: '4';
| ^~~~~~~~
input.y:14.1-8: warning: nonterminal useless in grammar: useless5 [-Wother]
14 | useless5: '5';
| ^~~~~~~~
input.y:15.1-8: warning: nonterminal useless in grammar: useless6 [-Wother]
15 | useless6: '6';
| ^~~~~~~~
input.y:16.1-8: warning: nonterminal useless in grammar: useless7 [-Wother]
16 | useless7: '7';
| ^~~~~~~~
input.y:17.1-8: warning: nonterminal useless in grammar: useless8 [-Wother]
17 | useless8: '8';
| ^~~~~~~~
input.y:18.1-8: warning: nonterminal useless in grammar: useless9 [-Wother]
18 | useless9: '9';
| ^~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:146"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:146: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "reduce.at:146"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:146"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:179: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:179"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Nonterminals useless in grammar
useless1
useless2
useless3
useless4
useless5
useless6
useless7
useless8
useless9
Terminals unused in grammar
'1'
'2'
'3'
'4'
'5'
'6'
'7'
'8'
'9'
Rules useless in grammar
2 useless1: '1'
3 useless2: '2'
4 useless3: '3'
5 useless4: '4'
6 useless5: '5'
7 useless6: '6'
8 useless7: '7'
9 useless8: '8'
10 useless9: '9'
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:179"
$at_failed && at_fn_log_failure
$at_traceon; }
# Make sure the generated parser is correct.
printf "%s\n" "reduce.at:213" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:213"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:213: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:213"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:213"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_177
#AT_START_178
at_fn_group_banner 178 'reduce.at:224' \
"Useless Parts" " " 8
at_xfail=no
(
printf "%s\n" "178. $at_setup_line: testing $at_desc ..."
$at_traceon
# We used to emit code that used symbol numbers before the useless
# symbol elimination, hence before the renumbering of the useful
# symbols. As a result, the evaluation of the skeleton failed because
# it used non existing symbol numbers. Which is the happy scenario:
# we could use numbers of other existing symbols...
# https://lists.gnu.org/r/bug-bison/2019-01/msg00044.html
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%union { void* ptr; }
%type <ptr> used1
%type <ptr> used2
%%
start
: used1
;
used1
: used2 { $$ = $1; }
;
unused
: used2
;
used2
: { $$ = YY_NULLPTR; }
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -rall -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -rall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y" "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -rall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:261"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:261"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:261"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 1 rule useless in grammar [-Wother]
input.y:18.1-6: warning: nonterminal useless in grammar: unused [-Wother]
18 | unused
| ^~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror" "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 1 rule useless in grammar [-Wother]
input.y:18.1-6: warning: nonterminal useless in grammar: unused [-Wother]
18 | unused
| ^~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:261"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error" "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:261: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:261"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -rall -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:261"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:270: sed -n '/^State 0/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0/q;/^$/!p' input.output" "reduce.at:270"
( $at_check_trace; sed -n '/^State 0/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Nonterminals useless in grammar
unused
Rules useless in grammar
4 unused: used2
Grammar
0 \$accept: start \$end
1 start: used1
2 used1: used2
3 used2: %empty
Terminals, with rules where they appear
\$end (0) 0
error (256)
Nonterminals, with rules where they appear
\$accept (3)
on left: 0
start (4)
on left: 1
on right: 0
used1 <ptr> (5)
on left: 2
on right: 1
used2 <ptr> (6)
on left: 3
on right: 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:270"
$at_failed && at_fn_log_failure
$at_traceon; }
# Make sure the generated parser is correct.
printf "%s\n" "reduce.at:298" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:298"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:298: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "reduce.at:298"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:298"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_178
#AT_START_179
at_fn_group_banner 179 'reduce.at:312' \
"Reduced Automaton" " " 8
at_xfail=no
(
printf "%s\n" "179. $at_setup_line: testing $at_desc ..."
$at_traceon
# The non reduced grammar.
# ------------------------
cat >not-reduced.y <<'_ATEOF'
/* A useless token. */
%token useless_token
/* A useful one. */
%token useful
%verbose
%output "not-reduced.c"
%%
exp: useful { /* A useful action. */ }
| non_productive { /* A non productive action. */ }
;
not_reachable: useful { /* A not reachable action. */ }
;
non_productive: non_productive useless_token
{ /* Another non productive action. */ }
;
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret not-reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y" "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:341"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret not-reduced.y"
at_fn_check_prepare_trace "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret not-reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "not-reduced.y: warning: 2 nonterminals useless in grammar [-Wother]
not-reduced.y: warning: 3 rules useless in grammar [-Wother]
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother]
14 | not_reachable: useful { /* A not reachable action. */ }
| ^~~~~~~~~~~~~
not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother]
17 | non_productive: non_productive useless_token
| ^~~~~~~~~~~~~~
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
11 | | non_productive { /* A non productive action. */ }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror" "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
not-reduced.y: warning: 2 nonterminals useless in grammar [-Wother]
not-reduced.y: warning: 3 rules useless in grammar [-Wother]
not-reduced.y:14.1-13: warning: nonterminal useless in grammar: not_reachable [-Wother]
14 | not_reachable: useful { /* A not reachable action. */ }
| ^~~~~~~~~~~~~
not-reduced.y:17.1-14: warning: nonterminal useless in grammar: non_productive [-Wother]
17 | non_productive: non_productive useless_token
| ^~~~~~~~~~~~~~
not-reduced.y:11.6-57: warning: rule useless in grammar [-Wother]
11 | | non_productive { /* A non productive action. */ }
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:341"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error" "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none" "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none" "reduce.at:341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret not-reduced.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:341"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:355: sed -n '/^Grammar/q;/^\$/!p' not-reduced.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' not-reduced.output" "reduce.at:355"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' not-reduced.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Nonterminals useless in grammar
not_reachable
non_productive
Terminals unused in grammar
useless_token
Rules useless in grammar
2 exp: non_productive
3 not_reachable: useful
4 non_productive: non_productive useless_token
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:355"
$at_failed && at_fn_log_failure
$at_traceon; }
# The reduced grammar.
# --------------------
cat >reduced.y <<'_ATEOF'
/* A useless token. */
%token useless_token
/* A useful one. */
%token useful
%verbose
%output "reduced.c"
%%
exp: useful { /* A useful action. */ }
// | non_productive { /* A non productive action. */ } */
;
//not_reachable: useful { /* A not reachable action. */ }
// ;
//non_productive: non_productive useless_token
// { /* Another non productive action. */ }
// ;
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv reduced.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y" "reduce.at:392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:392"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:392"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:392"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret reduced.y"
at_fn_check_prepare_trace "reduce.at:392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret reduced.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Comparing the parsers.
cp reduced.c expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:396: sed 's/not-reduced/reduced/g' not-reduced.c"
at_fn_check_prepare_trace "reduce.at:396"
( $at_check_trace; sed 's/not-reduced/reduced/g' not-reduced.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:396"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_179
#AT_START_180
at_fn_group_banner 180 'reduce.at:406' \
"Underivable Rules" " " 8
at_xfail=no
(
printf "%s\n" "180. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%verbose
%output "input.c"
%token useful
%%
exp: useful | underivable;
underivable: indirection;
indirection: underivable;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y" "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:420"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:420"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:420"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y"
at_fn_check_prepare_trace "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother]
6 | underivable: indirection;
| ^~~~~~~~~~~
input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother]
7 | indirection: underivable;
| ^~~~~~~~~~~
input.y:5.15-25: warning: rule useless in grammar [-Wother]
5 | exp: useful | underivable;
| ^~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror" "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 3 rules useless in grammar [-Wother]
input.y:6.1-11: warning: nonterminal useless in grammar: underivable [-Wother]
6 | underivable: indirection;
| ^~~~~~~~~~~
input.y:7.1-11: warning: nonterminal useless in grammar: indirection [-Wother]
7 | indirection: underivable;
| ^~~~~~~~~~~
input.y:5.15-25: warning: rule useless in grammar [-Wother]
5 | exp: useful | underivable;
| ^~~~~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:420"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error" "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none" "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:420: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none" "reduce.at:420"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:420"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:434: sed -n '/^Grammar/q;/^\$/!p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^Grammar/q;/^$/!p' input.output" "reduce.at:434"
( $at_check_trace; sed -n '/^Grammar/q;/^$/!p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Nonterminals useless in grammar
underivable
indirection
Rules useless in grammar
2 exp: underivable
3 underivable: indirection
4 indirection: underivable
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:434"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_180
#AT_START_181
at_fn_group_banner 181 'reduce.at:452' \
"Bad start symbols" " " 8
at_xfail=no
(
printf "%s\n" "181. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: exp;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:467: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:467"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 2 rules useless in grammar [-Wother]
input.y:2.1-3: error: start symbol exp does not derive any sentence
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:467"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
%start exp;
exp: exp;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:473: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:473"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 nonterminals useless in grammar [-Wother]
input.y: warning: 2 rules useless in grammar [-Wother]
input.y:2.8-10: error: start symbol exp does not derive any sentence
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:473"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
%start exp stmt;
exp: exp;
stmt: "stmt"
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:480: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:480"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 nonterminal useless in grammar [-Wother]
input.y: warning: 2 rules useless in grammar [-Wother]
input.y:2.8-10: error: start symbol exp does not derive any sentence
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:480"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
%start exp stmt;
exp: exp;
stmt: stmt
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:488: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:488"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 3 nonterminals useless in grammar [-Wother]
input.y: warning: 4 rules useless in grammar [-Wother]
input.y:2.8-10: error: start symbol exp does not derive any sentence
input.y:2.12-15: error: start symbol stmt does not derive any sentence
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:488"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
%start exp;
stmt: stmt
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: warning: symbol 'exp' is used, but is not defined as a token and has no rules [-Wother]
input.y: warning: 3 nonterminals useless in grammar [-Wother]
input.y: warning: 2 rules useless in grammar [-Wother]
input.y:2.8-10: error: start symbol exp does not derive any sentence
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input.y <<'_ATEOF'
%%
%token FOO;
%start FOO;
stmt: FOO
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:505: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "reduce.at:505"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: error: the start symbol FOO is a token
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:505"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_181
#AT_START_182
at_fn_group_banner 182 'reduce.at:550' \
"no lr.type: Single State Split" " " 8
at_xfail=no
(
printf "%s\n" "182. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%left 'a'
// Conflict resolution renders state 12 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
/* A conflict should appear after the first 'a' in rules 4 and 5 but only after
having shifted the first 'a' in rule 1. However, when LALR(1) merging is
chosen, the state containing that conflict is reused after having seen the
first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases,
because of the merged state, if the next token is an 'a', the %left forces a
reduction action with rule 5. In the latter case, only a shift is actually
grammatically correct. Thus, the parser would report a syntax error for the
grammatically correct sentence "baab" because it would encounter a syntax
error after that incorrect reduction.
Despite not being LALR(1), Menhir version 20070322 suffers from this problem
as well. It uses David Pager's weak compatibility test for merging states.
Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager
designed his algorithm only for LR(1) grammars. */
A: 'a' 'a' /* rule 4 */
| 'a' /* rule 5 */
;
/* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
useless after conflict resolution. This proves that, even though LALR(1)
generates incorrect parser tables sometimes, Bison will not necessarily
produce any warning to help the user realize it. */
c: 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:550"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a'
5 | . 'a'
6 c: . 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a'
5 | 'a' . ['a', 'b']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a'
5 | 'a' . [\$end]
6 c: 'a' . 'b'
'a' shift, and go to state 12
'b' shift, and go to state 15
\$default reduce using rule 5 (A)
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' .
\$default reduce using rule 4 (A)
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
6 c: 'a' 'b' .
\$default reduce using rule 6 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:550" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:550"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:550"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:550"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_182
#AT_START_183
at_fn_group_banner 183 'reduce.at:550' \
"lr.type=lalr: Single State Split" " " 8
at_xfail=no
(
printf "%s\n" "183. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type lalr
%left 'a'
// Conflict resolution renders state 12 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
/* A conflict should appear after the first 'a' in rules 4 and 5 but only after
having shifted the first 'a' in rule 1. However, when LALR(1) merging is
chosen, the state containing that conflict is reused after having seen the
first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases,
because of the merged state, if the next token is an 'a', the %left forces a
reduction action with rule 5. In the latter case, only a shift is actually
grammatically correct. Thus, the parser would report a syntax error for the
grammatically correct sentence "baab" because it would encounter a syntax
error after that incorrect reduction.
Despite not being LALR(1), Menhir version 20070322 suffers from this problem
as well. It uses David Pager's weak compatibility test for merging states.
Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager
designed his algorithm only for LR(1) grammars. */
A: 'a' 'a' /* rule 4 */
| 'a' /* rule 5 */
;
/* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
useless after conflict resolution. This proves that, even though LALR(1)
generates incorrect parser tables sometimes, Bison will not necessarily
produce any warning to help the user realize it. */
c: 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:550"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a'
5 | . 'a'
6 c: . 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a'
5 | 'a' . ['a', 'b']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a'
5 | 'a' . [\$end]
6 c: 'a' . 'b'
'a' shift, and go to state 12
'b' shift, and go to state 15
\$default reduce using rule 5 (A)
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' .
\$default reduce using rule 4 (A)
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
6 c: 'a' 'b' .
\$default reduce using rule 6 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:550" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:550"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:550"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:550"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_183
#AT_START_184
at_fn_group_banner 184 'reduce.at:550' \
"lr.type=ielr: Single State Split" " " 8
at_xfail=no
(
printf "%s\n" "184. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type ielr
%left 'a'
// Conflict resolution renders state 12 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
/* A conflict should appear after the first 'a' in rules 4 and 5 but only after
having shifted the first 'a' in rule 1. However, when LALR(1) merging is
chosen, the state containing that conflict is reused after having seen the
first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases,
because of the merged state, if the next token is an 'a', the %left forces a
reduction action with rule 5. In the latter case, only a shift is actually
grammatically correct. Thus, the parser would report a syntax error for the
grammatically correct sentence "baab" because it would encounter a syntax
error after that incorrect reduction.
Despite not being LALR(1), Menhir version 20070322 suffers from this problem
as well. It uses David Pager's weak compatibility test for merging states.
Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager
designed his algorithm only for LR(1) grammars. */
A: 'a' 'a' /* rule 4 */
| 'a' /* rule 5 */
;
/* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
useless after conflict resolution. This proves that, even though LALR(1)
generates incorrect parser tables sometimes, Bison will not necessarily
produce any warning to help the user realize it. */
c: 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:550"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 16
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a'
5 | . 'a'
6 c: . 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a'
5 | 'a' . ['a']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a'
5 | 'a' . [\$end]
6 c: 'a' . 'b'
'a' shift, and go to state 12
'b' shift, and go to state 15
\$default reduce using rule 5 (A)
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' .
\$default reduce using rule 4 (A)
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
6 c: 'a' 'b' .
\$default reduce using rule 6 (c)
State 16
4 A: 'a' . 'a'
5 | 'a' . ['b']
'a' shift, and go to state 12
\$default reduce using rule 5 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:550" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:550"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:550"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:550"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_184
#AT_START_185
at_fn_group_banner 185 'reduce.at:550' \
"lr.type=canonical-lr: Single State Split" " " 8
at_xfail=no
(
printf "%s\n" "185. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type canonical-lr
%left 'a'
// Conflict resolution renders state 12 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
/* A conflict should appear after the first 'a' in rules 4 and 5 but only after
having shifted the first 'a' in rule 1. However, when LALR(1) merging is
chosen, the state containing that conflict is reused after having seen the
first 'b' in rule 2 and then the first 'a' in rules 4 and 5. In both cases,
because of the merged state, if the next token is an 'a', the %left forces a
reduction action with rule 5. In the latter case, only a shift is actually
grammatically correct. Thus, the parser would report a syntax error for the
grammatically correct sentence "baab" because it would encounter a syntax
error after that incorrect reduction.
Despite not being LALR(1), Menhir version 20070322 suffers from this problem
as well. It uses David Pager's weak compatibility test for merging states.
Bison and Menhir accept non-LR(1) grammars with conflict resolution. Pager
designed his algorithm only for LR(1) grammars. */
A: 'a' 'a' /* rule 4 */
| 'a' /* rule 5 */
;
/* Rule 3, rule 6, and rule 7 ensure that Bison does not report rule 4 as
useless after conflict resolution. This proves that, even though LALR(1)
generates incorrect parser tables sometimes, Bison will not necessarily
produce any warning to help the user realize it. */
c: 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:550"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:550"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a'
5 | . 'a'
'a' shift, and go to state 16
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a'
5 | . 'a'
6 c: . 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a'
5 | 'a' . ['a']
'a' reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a'
5 | 'a' . [\$end]
6 c: 'a' . 'b'
'a' shift, and go to state 17
'b' shift, and go to state 15
\$end reduce using rule 5 (A)
State 9
7 c: A . [\$end]
\$end reduce using rule 7 (c)
State 10
3 S: 'c' c . [\$end]
\$end reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . ['a']
'a' reduce using rule 4 (A)
State 13
1 S: 'a' A 'a' . [\$end]
\$end reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' . [\$end]
\$end reduce using rule 2 (S)
State 15
6 c: 'a' 'b' . [\$end]
\$end reduce using rule 6 (c)
State 16
4 A: 'a' . 'a'
5 | 'a' . ['b']
'a' shift, and go to state 18
'b' reduce using rule 5 (A)
State 17
4 A: 'a' 'a' . [\$end]
\$end reduce using rule 4 (A)
State 18
4 A: 'a' 'a' . ['b']
'b' reduce using rule 4 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
if test 32767 -lt `wc -l < input.c`; then
CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
fi
printf "%s\n" "reduce.at:550" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:550"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:550"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:550"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:550: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:550"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:550"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_185
#AT_START_186
at_fn_group_banner 186 'reduce.at:783' \
"no lr.type: Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "186. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but two states must be split. */
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
A: 'a' 'a' 'a' /* rule 4 */
| 'a' 'a' /* rule 5 */
;
c: 'a' 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:783"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
6 c: . 'a' 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
6 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['a', 'b']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . [\$end]
6 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 17
\$default reduce using rule 5 (A)
State 16
4 A: 'a' 'a' 'a' .
\$default reduce using rule 4 (A)
State 17
6 c: 'a' 'a' 'b' .
\$default reduce using rule 6 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:783" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:783"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:783"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:783"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_186
#AT_START_187
at_fn_group_banner 187 'reduce.at:783' \
"lr.type=lalr: Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "187. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type lalr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but two states must be split. */
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
A: 'a' 'a' 'a' /* rule 4 */
| 'a' 'a' /* rule 5 */
;
c: 'a' 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:783"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
6 c: . 'a' 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
6 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['a', 'b']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . [\$end]
6 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 17
\$default reduce using rule 5 (A)
State 16
4 A: 'a' 'a' 'a' .
\$default reduce using rule 4 (A)
State 17
6 c: 'a' 'a' 'b' .
\$default reduce using rule 6 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:783" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:783"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:783"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:783"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_187
#AT_START_188
at_fn_group_banner 188 'reduce.at:783' \
"lr.type=ielr: Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "188. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type ielr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but two states must be split. */
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
A: 'a' 'a' 'a' /* rule 4 */
| 'a' 'a' /* rule 5 */
;
c: 'a' 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:783"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 18
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
6 c: . 'a' 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
6 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
7 c: A .
\$default reduce using rule 7 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['a']
\$default reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . [\$end]
6 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 17
\$default reduce using rule 5 (A)
State 16
4 A: 'a' 'a' 'a' .
\$default reduce using rule 4 (A)
State 17
6 c: 'a' 'a' 'b' .
\$default reduce using rule 6 (c)
State 18
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 19
State 19
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['b']
'a' shift, and go to state 16
\$default reduce using rule 5 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:783" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:783"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:783"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:783"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_188
#AT_START_189
at_fn_group_banner 189 'reduce.at:783' \
"lr.type=canonical-lr: Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "189. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type canonical-lr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but two states must be split. */
S: 'a' A 'a' /* rule 1 */
| 'b' A 'b' /* rule 2 */
| 'c' c /* rule 3 */
;
A: 'a' 'a' 'a' /* rule 4 */
| 'a' 'a' /* rule 5 */
;
c: 'a' 'a' 'b' /* rule 6 */
| A /* rule 7 */
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:783"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:783"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
'a' shift, and go to state 18
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' 'a'
5 | . 'a' 'a'
6 c: . 'a' 'a' 'b'
7 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
6 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
7 c: A . [\$end]
\$end reduce using rule 7 (c)
State 10
3 S: 'c' c . [\$end]
\$end reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['a']
'a' reduce using rule 5 (A)
Conflict between rule 5 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' . [\$end]
\$end reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' . [\$end]
\$end reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . [\$end]
6 c: 'a' 'a' . 'b'
'a' shift, and go to state 19
'b' shift, and go to state 17
\$end reduce using rule 5 (A)
State 16
4 A: 'a' 'a' 'a' . ['a']
'a' reduce using rule 4 (A)
State 17
6 c: 'a' 'a' 'b' . [\$end]
\$end reduce using rule 6 (c)
State 18
4 A: 'a' . 'a' 'a'
5 | 'a' . 'a'
'a' shift, and go to state 20
State 19
4 A: 'a' 'a' 'a' . [\$end]
\$end reduce using rule 4 (A)
State 20
4 A: 'a' 'a' . 'a'
5 | 'a' 'a' . ['b']
'a' shift, and go to state 21
'b' reduce using rule 5 (A)
State 21
4 A: 'a' 'a' 'a' . ['b']
'b' reduce using rule 4 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
if test 32767 -lt `wc -l < input.c`; then
CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
fi
printf "%s\n" "reduce.at:783" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:783"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:783"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:783"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:783: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:783"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:783"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_189
#AT_START_190
at_fn_group_banner 190 'reduce.at:1027' \
"no lr.type: Complex Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "190. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but forseeing the S/R conflict from the
first state that must be split is becoming difficult. Imagine if B were
even more complex. Imagine if A had other RHS's ending in other
nonterminals. */
S: 'a' A 'a'
| 'b' A 'b'
| 'c' c
;
A: 'a' 'a' B
;
B: 'a'
| %empty %prec 'a'
;
c: 'a' 'a' 'b'
| A
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1027"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' B
7 c: . 'a' 'a' 'b'
8 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' B
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' B
7 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
8 c: A .
\$default reduce using rule 8 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['a', 'b']
\$default reduce using rule 6 (B)
B go to state 17
Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . [\$end]
7 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 18
\$default reduce using rule 6 (B)
B go to state 17
State 16
5 B: 'a' .
\$default reduce using rule 5 (B)
State 17
4 A: 'a' 'a' B .
\$default reduce using rule 4 (A)
State 18
7 c: 'a' 'a' 'b' .
\$default reduce using rule 7 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1027" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1027"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1027"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1027"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_190
#AT_START_191
at_fn_group_banner 191 'reduce.at:1027' \
"lr.type=lalr: Complex Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "191. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type lalr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but forseeing the S/R conflict from the
first state that must be split is becoming difficult. Imagine if B were
even more complex. Imagine if A had other RHS's ending in other
nonterminals. */
S: 'a' A 'a'
| 'b' A 'b'
| 'c' c
;
A: 'a' 'a' B
;
B: 'a'
| %empty %prec 'a'
;
c: 'a' 'a' 'b'
| A
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1027"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' B
7 c: . 'a' 'a' 'b'
8 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' B
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' B
7 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
8 c: A .
\$default reduce using rule 8 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['a', 'b']
\$default reduce using rule 6 (B)
B go to state 17
Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . [\$end]
7 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 18
\$default reduce using rule 6 (B)
B go to state 17
State 16
5 B: 'a' .
\$default reduce using rule 5 (B)
State 17
4 A: 'a' 'a' B .
\$default reduce using rule 4 (A)
State 18
7 c: 'a' 'a' 'b' .
\$default reduce using rule 7 (c)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1027" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1027"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1027"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1027"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_191
#AT_START_192
at_fn_group_banner 192 'reduce.at:1027' \
"lr.type=ielr: Complex Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "192. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type ielr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but forseeing the S/R conflict from the
first state that must be split is becoming difficult. Imagine if B were
even more complex. Imagine if A had other RHS's ending in other
nonterminals. */
S: 'a' A 'a'
| 'b' A 'b'
| 'c' c
;
A: 'a' 'a' B
;
B: 'a'
| %empty %prec 'a'
;
c: 'a' 'a' 'b'
| A
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1027"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' B
'a' shift, and go to state 19
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' B
7 c: . 'a' 'a' 'b'
8 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' B
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' B
7 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
8 c: A .
\$default reduce using rule 8 (c)
State 10
3 S: 'c' c .
\$default reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['a']
\$default reduce using rule 6 (B)
B go to state 17
Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' .
\$default reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' .
\$default reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . [\$end]
7 c: 'a' 'a' . 'b'
'a' shift, and go to state 16
'b' shift, and go to state 18
\$default reduce using rule 6 (B)
B go to state 17
State 16
5 B: 'a' .
\$default reduce using rule 5 (B)
State 17
4 A: 'a' 'a' B .
\$default reduce using rule 4 (A)
State 18
7 c: 'a' 'a' 'b' .
\$default reduce using rule 7 (c)
State 19
4 A: 'a' . 'a' B
'a' shift, and go to state 20
State 20
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['b']
'a' shift, and go to state 16
\$default reduce using rule 6 (B)
B go to state 17
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1027" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1027"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1027"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1027"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_192
#AT_START_193
at_fn_group_banner 193 'reduce.at:1027' \
"lr.type=canonical-lr: Complex Lane Split" " " 8
at_xfail=no
(
printf "%s\n" "193. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type canonical-lr
%left 'a'
// Conflict resolution renders state 16 unreachable for canonical LR(1). We
// keep it so that the parser table diff is easier to code.
%define lr.keep-unreachable-state
%%
/* Similar to the last test case set but forseeing the S/R conflict from the
first state that must be split is becoming difficult. Imagine if B were
even more complex. Imagine if A had other RHS's ending in other
nonterminals. */
S: 'a' A 'a'
| 'b' A 'b'
| 'c' c
;
A: 'a' 'a' B
;
B: 'a'
| %empty %prec 'a'
;
c: 'a' 'a' 'b'
| A
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'a', 'a', 'a', 'b', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1027"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1027"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'a'
2 | . 'b' A 'b'
3 | . 'c' c
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'a'
4 A: . 'a' 'a' B
'a' shift, and go to state 5
A go to state 6
State 2
2 S: 'b' . A 'b'
4 A: . 'a' 'a' B
'a' shift, and go to state 19
A go to state 7
State 3
3 S: 'c' . c
4 A: . 'a' 'a' B
7 c: . 'a' 'a' 'b'
8 | . A
'a' shift, and go to state 8
A go to state 9
c go to state 10
State 4
0 \$accept: S . \$end
\$end shift, and go to state 11
State 5
4 A: 'a' . 'a' B
'a' shift, and go to state 12
State 6
1 S: 'a' A . 'a'
'a' shift, and go to state 13
State 7
2 S: 'b' A . 'b'
'b' shift, and go to state 14
State 8
4 A: 'a' . 'a' B
7 c: 'a' . 'a' 'b'
'a' shift, and go to state 15
State 9
8 c: A . [\$end]
\$end reduce using rule 8 (c)
State 10
3 S: 'c' c . [\$end]
\$end reduce using rule 3 (S)
State 11
0 \$accept: S \$end .
\$default accept
State 12
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['a']
'a' reduce using rule 6 (B)
B go to state 17
Conflict between rule 6 and token 'a' resolved as reduce (%left 'a').
State 13
1 S: 'a' A 'a' . [\$end]
\$end reduce using rule 1 (S)
State 14
2 S: 'b' A 'b' . [\$end]
\$end reduce using rule 2 (S)
State 15
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . [\$end]
7 c: 'a' 'a' . 'b'
'a' shift, and go to state 20
'b' shift, and go to state 18
\$end reduce using rule 6 (B)
B go to state 21
State 16
5 B: 'a' . ['a']
'a' reduce using rule 5 (B)
State 17
4 A: 'a' 'a' B . ['a']
'a' reduce using rule 4 (A)
State 18
7 c: 'a' 'a' 'b' . [\$end]
\$end reduce using rule 7 (c)
State 19
4 A: 'a' . 'a' B
'a' shift, and go to state 22
State 20
5 B: 'a' . [\$end]
\$end reduce using rule 5 (B)
State 21
4 A: 'a' 'a' B . [\$end]
\$end reduce using rule 4 (A)
State 22
4 A: 'a' 'a' . B
5 B: . 'a'
6 | %empty . ['b']
'a' shift, and go to state 23
'b' reduce using rule 6 (B)
B go to state 24
State 23
5 B: 'a' . ['b']
'b' reduce using rule 5 (B)
State 24
4 A: 'a' 'a' B . ['b']
'b' reduce using rule 4 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
if test 32767 -lt `wc -l < input.c`; then
CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
fi
printf "%s\n" "reduce.at:1027" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1027"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1027"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1027"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1027: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1027"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1027"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_193
#AT_START_194
at_fn_group_banner 194 'reduce.at:1296' \
"no lr.type: Split During Added Lookahead Propagation" "" 8
at_xfail=no
(
printf "%s\n" "194. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.keep-unreachable-state
%%
/* The partial state chart diagram below is for LALR(1). State 0 is the start
state. States are iterated for successor construction in numerical order.
Transitions are downwards.
State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
algorithm using annotations alone. That is, when state 11's successor on
'd' is merged with state 5 (which is originally just state 1's successor on
'd'), state 5's successor on 'e' must then be changed because the resulting
lookaheads that propagate to it now make it incompatible with state 8's
successor on 'e'. In other words, state 13 must be split to avoid the
conflict.
0
/ | \
a / c| \ b
1 3 2
| | |
d| |c | d
| 11 |
| | |
\ /d |
5 8
\ |
e \ / e
13
R/R
This grammar is designed carefully to make sure that, despite Bison's LR(1)
algorithm's bread-first iteration of transitions to reconstruct states,
state 11's successors are constructed after state 5's and state 8's.
Otherwise (for example, if you remove the first 'c' in each of rules 6 and
7), state 5's successor on 'e' would never be merged with state 8's, so the
split of the resulting state 13 would never need to be performed. */
S: 'a' A 'f'
| 'a' B
| 'b' A 'f'
| 'b' B 'g'
| 'b' 'd'
| 'c' 'c' A 'g'
| 'c' 'c' B
;
A: 'd' 'e' ;
B: 'd' 'e' ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'd', 'e', 'g', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1296"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1296"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'f'
2 | . 'a' B
3 | . 'b' A 'f'
4 | . 'b' B 'g'
5 | . 'b' 'd'
6 | . 'c' 'c' A 'g'
7 | . 'c' 'c' B
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'f'
2 | 'a' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 6
B go to state 7
State 2
3 S: 'b' . A 'f'
4 | 'b' . B 'g'
5 | 'b' . 'd'
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 8
A go to state 9
B go to state 10
State 3
6 S: 'c' . 'c' A 'g'
7 | 'c' . 'c' B
'c' shift, and go to state 11
State 4
0 \$accept: S . \$end
\$end shift, and go to state 12
State 5
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
State 6
1 S: 'a' A . 'f'
'f' shift, and go to state 14
State 7
2 S: 'a' B .
\$default reduce using rule 2 (S)
State 8
5 S: 'b' 'd' . [\$end]
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
\$default reduce using rule 5 (S)
State 9
3 S: 'b' A . 'f'
'f' shift, and go to state 15
State 10
4 S: 'b' B . 'g'
'g' shift, and go to state 16
State 11
6 S: 'c' 'c' . A 'g'
7 | 'c' 'c' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 17
B go to state 18
State 12
0 \$accept: S \$end .
\$default accept
State 13
8 A: 'd' 'e' . ['f', 'g']
9 B: 'd' 'e' . [\$end, 'g']
\$end reduce using rule 9 (B)
'g' reduce using rule 8 (A)
'g' [reduce using rule 9 (B)]
\$default reduce using rule 8 (A)
State 14
1 S: 'a' A 'f' .
\$default reduce using rule 1 (S)
State 15
3 S: 'b' A 'f' .
\$default reduce using rule 3 (S)
State 16
4 S: 'b' B 'g' .
\$default reduce using rule 4 (S)
State 17
6 S: 'c' 'c' A . 'g'
'g' shift, and go to state 19
State 18
7 S: 'c' 'c' B .
\$default reduce using rule 7 (S)
State 19
6 S: 'c' 'c' A 'g' .
\$default reduce using rule 6 (S)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1296" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1296"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1296"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1296"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_194
#AT_START_195
at_fn_group_banner 195 'reduce.at:1296' \
"lr.type=lalr: Split During Added Lookahead Propagation" "" 8
at_xfail=no
(
printf "%s\n" "195. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type lalr
%define lr.keep-unreachable-state
%%
/* The partial state chart diagram below is for LALR(1). State 0 is the start
state. States are iterated for successor construction in numerical order.
Transitions are downwards.
State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
algorithm using annotations alone. That is, when state 11's successor on
'd' is merged with state 5 (which is originally just state 1's successor on
'd'), state 5's successor on 'e' must then be changed because the resulting
lookaheads that propagate to it now make it incompatible with state 8's
successor on 'e'. In other words, state 13 must be split to avoid the
conflict.
0
/ | \
a / c| \ b
1 3 2
| | |
d| |c | d
| 11 |
| | |
\ /d |
5 8
\ |
e \ / e
13
R/R
This grammar is designed carefully to make sure that, despite Bison's LR(1)
algorithm's bread-first iteration of transitions to reconstruct states,
state 11's successors are constructed after state 5's and state 8's.
Otherwise (for example, if you remove the first 'c' in each of rules 6 and
7), state 5's successor on 'e' would never be merged with state 8's, so the
split of the resulting state 13 would never need to be performed. */
S: 'a' A 'f'
| 'a' B
| 'b' A 'f'
| 'b' B 'g'
| 'b' 'd'
| 'c' 'c' A 'g'
| 'c' 'c' B
;
A: 'd' 'e' ;
B: 'd' 'e' ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'd', 'e', 'g', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "reduce.at:1296"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1296"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'f'
2 | . 'a' B
3 | . 'b' A 'f'
4 | . 'b' B 'g'
5 | . 'b' 'd'
6 | . 'c' 'c' A 'g'
7 | . 'c' 'c' B
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'f'
2 | 'a' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 6
B go to state 7
State 2
3 S: 'b' . A 'f'
4 | 'b' . B 'g'
5 | 'b' . 'd'
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 8
A go to state 9
B go to state 10
State 3
6 S: 'c' . 'c' A 'g'
7 | 'c' . 'c' B
'c' shift, and go to state 11
State 4
0 \$accept: S . \$end
\$end shift, and go to state 12
State 5
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
State 6
1 S: 'a' A . 'f'
'f' shift, and go to state 14
State 7
2 S: 'a' B .
\$default reduce using rule 2 (S)
State 8
5 S: 'b' 'd' . [\$end]
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
\$default reduce using rule 5 (S)
State 9
3 S: 'b' A . 'f'
'f' shift, and go to state 15
State 10
4 S: 'b' B . 'g'
'g' shift, and go to state 16
State 11
6 S: 'c' 'c' . A 'g'
7 | 'c' 'c' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 17
B go to state 18
State 12
0 \$accept: S \$end .
\$default accept
State 13
8 A: 'd' 'e' . ['f', 'g']
9 B: 'd' 'e' . [\$end, 'g']
\$end reduce using rule 9 (B)
'g' reduce using rule 8 (A)
'g' [reduce using rule 9 (B)]
\$default reduce using rule 8 (A)
State 14
1 S: 'a' A 'f' .
\$default reduce using rule 1 (S)
State 15
3 S: 'b' A 'f' .
\$default reduce using rule 3 (S)
State 16
4 S: 'b' B 'g' .
\$default reduce using rule 4 (S)
State 17
6 S: 'c' 'c' A . 'g'
'g' shift, and go to state 19
State 18
7 S: 'c' 'c' B .
\$default reduce using rule 7 (S)
State 19
6 S: 'c' 'c' A 'g' .
\$default reduce using rule 6 (S)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1296" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1296"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1296"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1296"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_195
#AT_START_196
at_fn_group_banner 196 'reduce.at:1296' \
"lr.type=ielr: Split During Added Lookahead Propagation" "" 8
at_xfail=no
(
printf "%s\n" "196. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type ielr
%define lr.keep-unreachable-state
%%
/* The partial state chart diagram below is for LALR(1). State 0 is the start
state. States are iterated for successor construction in numerical order.
Transitions are downwards.
State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
algorithm using annotations alone. That is, when state 11's successor on
'd' is merged with state 5 (which is originally just state 1's successor on
'd'), state 5's successor on 'e' must then be changed because the resulting
lookaheads that propagate to it now make it incompatible with state 8's
successor on 'e'. In other words, state 13 must be split to avoid the
conflict.
0
/ | \
a / c| \ b
1 3 2
| | |
d| |c | d
| 11 |
| | |
\ /d |
5 8
\ |
e \ / e
13
R/R
This grammar is designed carefully to make sure that, despite Bison's LR(1)
algorithm's bread-first iteration of transitions to reconstruct states,
state 11's successors are constructed after state 5's and state 8's.
Otherwise (for example, if you remove the first 'c' in each of rules 6 and
7), state 5's successor on 'e' would never be merged with state 8's, so the
split of the resulting state 13 would never need to be performed. */
S: 'a' A 'f'
| 'a' B
| 'b' A 'f'
| 'b' B 'g'
| 'b' 'd'
| 'c' 'c' A 'g'
| 'c' 'c' B
;
A: 'd' 'e' ;
B: 'd' 'e' ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'd', 'e', 'g', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1296"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'f'
2 | . 'a' B
3 | . 'b' A 'f'
4 | . 'b' B 'g'
5 | . 'b' 'd'
6 | . 'c' 'c' A 'g'
7 | . 'c' 'c' B
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'f'
2 | 'a' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 6
B go to state 7
State 2
3 S: 'b' . A 'f'
4 | 'b' . B 'g'
5 | 'b' . 'd'
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 8
A go to state 9
B go to state 10
State 3
6 S: 'c' . 'c' A 'g'
7 | 'c' . 'c' B
'c' shift, and go to state 11
State 4
0 \$accept: S . \$end
\$end shift, and go to state 12
State 5
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 20
State 6
1 S: 'a' A . 'f'
'f' shift, and go to state 14
State 7
2 S: 'a' B .
\$default reduce using rule 2 (S)
State 8
5 S: 'b' 'd' . [\$end]
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
\$default reduce using rule 5 (S)
State 9
3 S: 'b' A . 'f'
'f' shift, and go to state 15
State 10
4 S: 'b' B . 'g'
'g' shift, and go to state 16
State 11
6 S: 'c' 'c' . A 'g'
7 | 'c' 'c' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 17
B go to state 18
State 12
0 \$accept: S \$end .
\$default accept
State 13
8 A: 'd' 'e' . ['f']
9 B: 'd' 'e' . ['g']
'g' reduce using rule 9 (B)
\$default reduce using rule 8 (A)
State 14
1 S: 'a' A 'f' .
\$default reduce using rule 1 (S)
State 15
3 S: 'b' A 'f' .
\$default reduce using rule 3 (S)
State 16
4 S: 'b' B 'g' .
\$default reduce using rule 4 (S)
State 17
6 S: 'c' 'c' A . 'g'
'g' shift, and go to state 19
State 18
7 S: 'c' 'c' B .
\$default reduce using rule 7 (S)
State 19
6 S: 'c' 'c' A 'g' .
\$default reduce using rule 6 (S)
State 20
8 A: 'd' 'e' . ['f', 'g']
9 B: 'd' 'e' . [\$end]
\$end reduce using rule 9 (B)
\$default reduce using rule 8 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1296" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1296"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1296"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1296"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_196
#AT_START_197
at_fn_group_banner 197 'reduce.at:1296' \
"lr.type=canonical-lr: Split During Added Lookahead Propagation" "" 8
at_xfail=no
(
printf "%s\n" "197. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.type canonical-lr
%define lr.keep-unreachable-state
%%
/* The partial state chart diagram below is for LALR(1). State 0 is the start
state. States are iterated for successor construction in numerical order.
Transitions are downwards.
State 13 has a R/R conflict that cannot be predicted by Bison's LR(1)
algorithm using annotations alone. That is, when state 11's successor on
'd' is merged with state 5 (which is originally just state 1's successor on
'd'), state 5's successor on 'e' must then be changed because the resulting
lookaheads that propagate to it now make it incompatible with state 8's
successor on 'e'. In other words, state 13 must be split to avoid the
conflict.
0
/ | \
a / c| \ b
1 3 2
| | |
d| |c | d
| 11 |
| | |
\ /d |
5 8
\ |
e \ / e
13
R/R
This grammar is designed carefully to make sure that, despite Bison's LR(1)
algorithm's bread-first iteration of transitions to reconstruct states,
state 11's successors are constructed after state 5's and state 8's.
Otherwise (for example, if you remove the first 'c' in each of rules 6 and
7), state 5's successor on 'e' would never be merged with state 8's, so the
split of the resulting state 13 would never need to be performed. */
S: 'a' A 'f'
| 'a' B
| 'b' A 'f'
| 'b' B 'g'
| 'b' 'd'
| 'c' 'c' A 'g'
| 'c' 'c' B
;
A: 'd' 'e' ;
B: 'd' 'e' ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'b', 'd', 'e', 'g', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1296"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1296"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . S \$end
1 S: . 'a' A 'f'
2 | . 'a' B
3 | . 'b' A 'f'
4 | . 'b' B 'g'
5 | . 'b' 'd'
6 | . 'c' 'c' A 'g'
7 | . 'c' 'c' B
'a' shift, and go to state 1
'b' shift, and go to state 2
'c' shift, and go to state 3
S go to state 4
State 1
1 S: 'a' . A 'f'
2 | 'a' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 5
A go to state 6
B go to state 7
State 2
3 S: 'b' . A 'f'
4 | 'b' . B 'g'
5 | 'b' . 'd'
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 8
A go to state 9
B go to state 10
State 3
6 S: 'c' . 'c' A 'g'
7 | 'c' . 'c' B
'c' shift, and go to state 11
State 4
0 \$accept: S . \$end
\$end shift, and go to state 12
State 5
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 13
State 6
1 S: 'a' A . 'f'
'f' shift, and go to state 14
State 7
2 S: 'a' B . [\$end]
\$end reduce using rule 2 (S)
State 8
5 S: 'b' 'd' . [\$end]
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 20
\$end reduce using rule 5 (S)
State 9
3 S: 'b' A . 'f'
'f' shift, and go to state 15
State 10
4 S: 'b' B . 'g'
'g' shift, and go to state 16
State 11
6 S: 'c' 'c' . A 'g'
7 | 'c' 'c' . B
8 A: . 'd' 'e'
9 B: . 'd' 'e'
'd' shift, and go to state 21
A go to state 17
B go to state 18
State 12
0 \$accept: S \$end .
\$default accept
State 13
8 A: 'd' 'e' . ['f']
9 B: 'd' 'e' . [\$end]
\$end reduce using rule 9 (B)
'f' reduce using rule 8 (A)
State 14
1 S: 'a' A 'f' . [\$end]
\$end reduce using rule 1 (S)
State 15
3 S: 'b' A 'f' . [\$end]
\$end reduce using rule 3 (S)
State 16
4 S: 'b' B 'g' . [\$end]
\$end reduce using rule 4 (S)
State 17
6 S: 'c' 'c' A . 'g'
'g' shift, and go to state 19
State 18
7 S: 'c' 'c' B . [\$end]
\$end reduce using rule 7 (S)
State 19
6 S: 'c' 'c' A 'g' . [\$end]
\$end reduce using rule 6 (S)
State 20
8 A: 'd' 'e' . ['f']
9 B: 'd' 'e' . ['g']
'f' reduce using rule 8 (A)
'g' reduce using rule 9 (B)
State 21
8 A: 'd' . 'e'
9 B: 'd' . 'e'
'e' shift, and go to state 22
State 22
8 A: 'd' 'e' . ['g']
9 B: 'd' 'e' . [\$end]
\$end reduce using rule 9 (B)
'g' reduce using rule 8 (A)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
if test 32767 -lt `wc -l < input.c`; then
CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
fi
printf "%s\n" "reduce.at:1296" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1296"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1296"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1296"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1296: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1296"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1296"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_197
#AT_START_198
at_fn_group_banner 198 'reduce.at:1627' \
"no lr.default-reduction" " " 8
at_xfail=no
(
printf "%s\n" "198. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
/* The start state is consistent and has a shift on 'a' and no reductions.
After pushing the b below, enter an inconsistent state that has a shift and
one reduction with one lookahead. */
start:
a b
| a b 'a'
| a c 'b'
;
/* After shifting this 'a', enter a consistent state that has no shift and 1
reduction with multiple lookaheads. */
a: 'a' ;
/* After the previous reduction, enter an inconsistent state that has no shift
and multiple reductions. The first reduction has more lookaheads than the
second, so the first should always be preferred as the default reduction if
enabled. The second reduction has one lookahead. */
b: %empty;
c: %empty;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'a', 'a', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1627"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . a b
2 | . a b 'a'
3 | . a c 'b'
4 a: . 'a'
'a' shift, and go to state 1
start go to state 2
a go to state 3
State 1
4 a: 'a' .
\$default reduce using rule 4 (a)
State 2
0 \$accept: start . \$end
\$end shift, and go to state 4
State 3
1 start: a . b
2 | a . b 'a'
3 | a . c 'b'
5 b: %empty . [\$end, 'a']
6 c: %empty . ['b']
'b' reduce using rule 6 (c)
\$default reduce using rule 5 (b)
b go to state 5
c go to state 6
State 4
0 \$accept: start \$end .
\$default accept
State 5
1 start: a b . [\$end]
2 | a b . 'a'
'a' shift, and go to state 7
\$default reduce using rule 1 (start)
State 6
3 start: a c . 'b'
'b' shift, and go to state 8
State 7
2 start: a b 'a' .
\$default reduce using rule 2 (start)
State 8
3 start: a c 'b' .
\$default reduce using rule 3 (start)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1627" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1627"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1627"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1627"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_198
#AT_START_199
at_fn_group_banner 199 'reduce.at:1627' \
"lr.default-reduction=most" " " 8
at_xfail=no
(
printf "%s\n" "199. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.default-reduction most
%%
/* The start state is consistent and has a shift on 'a' and no reductions.
After pushing the b below, enter an inconsistent state that has a shift and
one reduction with one lookahead. */
start:
a b
| a b 'a'
| a c 'b'
;
/* After shifting this 'a', enter a consistent state that has no shift and 1
reduction with multiple lookaheads. */
a: 'a' ;
/* After the previous reduction, enter an inconsistent state that has no shift
and multiple reductions. The first reduction has more lookaheads than the
second, so the first should always be preferred as the default reduction if
enabled. The second reduction has one lookahead. */
b: %empty;
c: %empty;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'a', 'a', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1627"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . a b
2 | . a b 'a'
3 | . a c 'b'
4 a: . 'a'
'a' shift, and go to state 1
start go to state 2
a go to state 3
State 1
4 a: 'a' .
\$default reduce using rule 4 (a)
State 2
0 \$accept: start . \$end
\$end shift, and go to state 4
State 3
1 start: a . b
2 | a . b 'a'
3 | a . c 'b'
5 b: %empty . [\$end, 'a']
6 c: %empty . ['b']
'b' reduce using rule 6 (c)
\$default reduce using rule 5 (b)
b go to state 5
c go to state 6
State 4
0 \$accept: start \$end .
\$default accept
State 5
1 start: a b . [\$end]
2 | a b . 'a'
'a' shift, and go to state 7
\$default reduce using rule 1 (start)
State 6
3 start: a c . 'b'
'b' shift, and go to state 8
State 7
2 start: a b 'a' .
\$default reduce using rule 2 (start)
State 8
3 start: a c 'b' .
\$default reduce using rule 3 (start)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1627" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1627"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1627"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1627"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_199
#AT_START_200
at_fn_group_banner 200 'reduce.at:1627' \
"lr.default-reduction=consistent" " " 8
at_xfail=no
(
printf "%s\n" "200. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.default-reduction consistent
%%
/* The start state is consistent and has a shift on 'a' and no reductions.
After pushing the b below, enter an inconsistent state that has a shift and
one reduction with one lookahead. */
start:
a b
| a b 'a'
| a c 'b'
;
/* After shifting this 'a', enter a consistent state that has no shift and 1
reduction with multiple lookaheads. */
a: 'a' ;
/* After the previous reduction, enter an inconsistent state that has no shift
and multiple reductions. The first reduction has more lookaheads than the
second, so the first should always be preferred as the default reduction if
enabled. The second reduction has one lookahead. */
b: %empty;
c: %empty;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'a', 'a', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1627"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . a b
2 | . a b 'a'
3 | . a c 'b'
4 a: . 'a'
'a' shift, and go to state 1
start go to state 2
a go to state 3
State 1
4 a: 'a' .
\$default reduce using rule 4 (a)
State 2
0 \$accept: start . \$end
\$end shift, and go to state 4
State 3
1 start: a . b
2 | a . b 'a'
3 | a . c 'b'
5 b: %empty . [\$end, 'a']
6 c: %empty . ['b']
\$end reduce using rule 5 (b)
'a' reduce using rule 5 (b)
'b' reduce using rule 6 (c)
b go to state 5
c go to state 6
State 4
0 \$accept: start \$end .
\$default accept
State 5
1 start: a b . [\$end]
2 | a b . 'a'
'a' shift, and go to state 7
\$end reduce using rule 1 (start)
State 6
3 start: a c . 'b'
'b' shift, and go to state 8
State 7
2 start: a b 'a' .
\$default reduce using rule 2 (start)
State 8
3 start: a c 'b' .
\$default reduce using rule 3 (start)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1627" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1627"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1627"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1627"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_200
#AT_START_201
at_fn_group_banner 201 'reduce.at:1627' \
"lr.default-reduction=accepting" " " 8
at_xfail=no
(
printf "%s\n" "201. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define lr.default-reduction accepting
%%
/* The start state is consistent and has a shift on 'a' and no reductions.
After pushing the b below, enter an inconsistent state that has a shift and
one reduction with one lookahead. */
start:
a b
| a b 'a'
| a c 'b'
;
/* After shifting this 'a', enter a consistent state that has no shift and 1
reduction with multiple lookaheads. */
a: 'a' ;
/* After the previous reduction, enter an inconsistent state that has no shift
and multiple reductions. The first reduction has more lookaheads than the
second, so the first should always be preferred as the default reduction if
enabled. The second reduction has one lookahead. */
b: %empty;
c: %empty;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
static int
yylex (void)
{
static int const input[] = {
'a', 'a', 0
};
static int const *inputp = input;
return *inputp++;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# In some versions of Autoconf, AT_CHECK invokes AS_ESCAPE before
# expanding macros, so it corrupts some special characters in the
# macros. To avoid this, expand now and pass it the result with proper
# string quotation. Assume args 7 through 12 expand to properly quoted
# strings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y" "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "reduce.at:1627"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall --report=all,no-cex --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed -n '/^State 0\$/,\$p' input.output"
at_fn_check_prepare_dynamic "sed -n '/^State 0$/,$p' input.output" "reduce.at:1627"
( $at_check_trace; sed -n '/^State 0$/,$p' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . a b
2 | . a b 'a'
3 | . a c 'b'
4 a: . 'a'
'a' shift, and go to state 1
start go to state 2
a go to state 3
State 1
4 a: 'a' . [\$end, 'a', 'b']
\$end reduce using rule 4 (a)
'a' reduce using rule 4 (a)
'b' reduce using rule 4 (a)
State 2
0 \$accept: start . \$end
\$end shift, and go to state 4
State 3
1 start: a . b
2 | a . b 'a'
3 | a . c 'b'
5 b: %empty . [\$end, 'a']
6 c: %empty . ['b']
\$end reduce using rule 5 (b)
'a' reduce using rule 5 (b)
'b' reduce using rule 6 (c)
b go to state 5
c go to state 6
State 4
0 \$accept: start \$end .
\$default accept
State 5
1 start: a b . [\$end]
2 | a b . 'a'
'a' shift, and go to state 7
\$end reduce using rule 1 (start)
State 6
3 start: a c . 'b'
'b' shift, and go to state 8
State 7
2 start: a b 'a' . [\$end]
\$end reduce using rule 2 (start)
State 8
3 start: a c 'b' . [\$end]
\$end reduce using rule 3 (start)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
# Canonical LR generates very large tables, resulting in very long
# files with #line directives that may overflow what the standards
# (C90 and C++98) guarantee: 32767. In that case, GCC's -pedantic
# will issue an error.
#
# There is no "" around `wc` since some wc indent the result.
printf "%s\n" "reduce.at:1627" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/reduce.at:1627"
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "reduce.at:1627"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "reduce.at:1627"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/reduce.at:1627: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "reduce.at:1627"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/reduce.at:1627"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_201
#AT_START_202
at_fn_group_banner 202 'report.at:37' \
"Reports" " " 9
at_xfail=no
(
printf "%s\n" "202. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.yy <<'_ATEOF'
%token
END 0 "end of file"
ASSIGN ":="
INCR "incr"
;
%token <std::string> IDENTIFIER "identifier"
%type <std::string> id
%token <int> NUMBER "number"
%type <int> exp
%%
%start unit;
unit: assignments exp { driver.result = $2; };
assignments:
%empty {}
| assignments assignment {};
assignment:
id ":=" exp { driver.variables[$id] = $exp; };
id:
"identifier";
exp:
"incr" exp <int>{ $$ = 1; } <int>{ $$ = 10; } exp { $$ = $2 + $3 + $4 + $5; }
| "(" exp ")" { std::swap ($$, $2); }
| "identifier" { $$ = driver.variables[$1]; }
| "number" { std::swap ($$, $1); };
_ATEOF
printf "%s\n" "report.at:75" >"$at_check_line_file"
(test x"$XSLTPROC" = x) \
&& at_fn_check_skip 77 "$at_srcdir/report.at:75"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc -v --html --xml input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "report.at:76"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc -v --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --html --xml input.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --html --xml input.yy" "report.at:76"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -v --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:76"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "report.at:76"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:76"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/report.at:76: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -v --graph=input.gv --html --xml input.yy"
at_fn_check_prepare_trace "report.at:76"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -v --graph=input.gv --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:76"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the contents of the report.
{ set +x
printf "%s\n" "$at_srcdir/report.at:79: cat input.output"
at_fn_check_prepare_trace "report.at:79"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Grammar
0 \$accept: unit \"end of file\"
1 unit: assignments exp
2 assignments: %empty
3 | assignments assignment
4 assignment: id \":=\" exp
5 id: \"identifier\"
6 @1: %empty
7 @2: %empty
8 exp: \"incr\" exp @1 @2 exp
9 | \"(\" exp \")\"
10 | \"identifier\"
11 | \"number\"
Terminals, with rules where they appear
\"end of file\" (0) 0
error (256)
\":=\" (258) 4
\"incr\" (259) 8
\"identifier\" <std::string> (260) 5 10
\"number\" <int> (261) 11
\"(\" (262) 9
\")\" (263) 9
Nonterminals, with rules where they appear
\$accept (9)
on left: 0
unit (10)
on left: 1
on right: 0
assignments (11)
on left: 2 3
on right: 1 3
assignment (12)
on left: 4
on right: 3
id <std::string> (13)
on left: 5
on right: 4
exp <int> (14)
on left: 8 9 10 11
on right: 1 4 8 9
@1 <int> (15)
on left: 6
on right: 8
@2 <int> (16)
on left: 7
on right: 8
State 0
0 \$accept: . unit \"end of file\"
\$default reduce using rule 2 (assignments)
unit go to state 1
assignments go to state 2
State 1
0 \$accept: unit . \"end of file\"
\"end of file\" shift, and go to state 3
State 2
1 unit: assignments . exp
3 assignments: assignments . assignment
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 5
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
assignment go to state 8
id go to state 9
exp go to state 10
State 3
0 \$accept: unit \"end of file\" .
\$default accept
State 4
8 exp: \"incr\" . exp @1 @2 exp
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 12
State 5
5 id: \"identifier\" .
10 exp: \"identifier\" .
\"end of file\" reduce using rule 10 (exp)
\$default reduce using rule 5 (id)
State 6
11 exp: \"number\" .
\$default reduce using rule 11 (exp)
State 7
9 exp: \"(\" . exp \")\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 13
State 8
3 assignments: assignments assignment .
\$default reduce using rule 3 (assignments)
State 9
4 assignment: id . \":=\" exp
\":=\" shift, and go to state 14
State 10
1 unit: assignments exp .
\$default reduce using rule 1 (unit)
State 11
10 exp: \"identifier\" .
\$default reduce using rule 10 (exp)
State 12
8 exp: \"incr\" exp . @1 @2 exp
\$default reduce using rule 6 (@1)
@1 go to state 15
State 13
9 exp: \"(\" exp . \")\"
\")\" shift, and go to state 16
State 14
4 assignment: id \":=\" . exp
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 17
State 15
8 exp: \"incr\" exp @1 . @2 exp
\$default reduce using rule 7 (@2)
@2 go to state 18
State 16
9 exp: \"(\" exp \")\" .
\$default reduce using rule 9 (exp)
State 17
4 assignment: id \":=\" exp .
\$default reduce using rule 4 (assignment)
State 18
8 exp: \"incr\" exp @1 @2 . exp
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 19
State 19
8 exp: \"incr\" exp @1 @2 exp .
\$default reduce using rule 8 (exp)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:79"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now generate verbose reports.
printf "%s\n" "report.at:321" >"$at_check_line_file"
(test x"$XSLTPROC" = x) \
&& at_fn_check_skip 77 "$at_srcdir/report.at:321"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc -rall --html --xml input.yy"
at_fn_check_prepare_notrace 'an embedded newline' "report.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc -rall --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --html --xml input.yy"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --html --xml input.yy" "report.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -rall --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:322"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "report.at:322"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "report.at:322"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/report.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -rall --graph=input.gv --html --xml input.yy"
at_fn_check_prepare_trace "report.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -rall --graph=input.gv --html --xml input.yy
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the contents of the report.
{ set +x
printf "%s\n" "$at_srcdir/report.at:325: cat input.output"
at_fn_check_prepare_trace "report.at:325"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Grammar
0 \$accept: unit \"end of file\"
1 unit: assignments exp
2 assignments: %empty
3 | assignments assignment
4 assignment: id \":=\" exp
5 id: \"identifier\"
6 @1: %empty
7 @2: %empty
8 exp: \"incr\" exp @1 @2 exp
9 | \"(\" exp \")\"
10 | \"identifier\"
11 | \"number\"
Terminals, with rules where they appear
\"end of file\" (0) 0
error (256)
\":=\" (258) 4
\"incr\" (259) 8
\"identifier\" <std::string> (260) 5 10
\"number\" <int> (261) 11
\"(\" (262) 9
\")\" (263) 9
Nonterminals, with rules where they appear
\$accept (9)
on left: 0
unit (10)
on left: 1
on right: 0
assignments (11)
on left: 2 3
on right: 1 3
assignment (12)
on left: 4
on right: 3
id <std::string> (13)
on left: 5
on right: 4
exp <int> (14)
on left: 8 9 10 11
on right: 1 4 8 9
@1 <int> (15)
on left: 6
on right: 8
@2 <int> (16)
on left: 7
on right: 8
State 0
0 \$accept: . unit \"end of file\"
1 unit: . assignments exp
2 assignments: %empty .
3 | . assignments assignment
\$default reduce using rule 2 (assignments)
unit go to state 1
assignments go to state 2
State 1
0 \$accept: unit . \"end of file\"
\"end of file\" shift, and go to state 3
State 2
1 unit: assignments . exp
3 assignments: assignments . assignment
4 assignment: . id \":=\" exp
5 id: . \"identifier\"
8 exp: . \"incr\" exp @1 @2 exp
9 | . \"(\" exp \")\"
10 | . \"identifier\"
11 | . \"number\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 5
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
assignment go to state 8
id go to state 9
exp go to state 10
State 3
0 \$accept: unit \"end of file\" .
\$default accept
State 4
8 exp: . \"incr\" exp @1 @2 exp
8 | \"incr\" . exp @1 @2 exp
9 | . \"(\" exp \")\"
10 | . \"identifier\"
11 | . \"number\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 12
State 5
5 id: \"identifier\" . [\":=\"]
10 exp: \"identifier\" . [\"end of file\"]
\"end of file\" reduce using rule 10 (exp)
\$default reduce using rule 5 (id)
State 6
11 exp: \"number\" .
\$default reduce using rule 11 (exp)
State 7
8 exp: . \"incr\" exp @1 @2 exp
9 | . \"(\" exp \")\"
9 | \"(\" . exp \")\"
10 | . \"identifier\"
11 | . \"number\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 13
State 8
3 assignments: assignments assignment .
\$default reduce using rule 3 (assignments)
State 9
4 assignment: id . \":=\" exp
\":=\" shift, and go to state 14
State 10
1 unit: assignments exp .
\$default reduce using rule 1 (unit)
State 11
10 exp: \"identifier\" .
\$default reduce using rule 10 (exp)
State 12
6 @1: %empty .
8 exp: \"incr\" exp . @1 @2 exp
\$default reduce using rule 6 (@1)
@1 go to state 15
State 13
9 exp: \"(\" exp . \")\"
\")\" shift, and go to state 16
State 14
4 assignment: id \":=\" . exp
8 exp: . \"incr\" exp @1 @2 exp
9 | . \"(\" exp \")\"
10 | . \"identifier\"
11 | . \"number\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 17
State 15
7 @2: %empty .
8 exp: \"incr\" exp @1 . @2 exp
\$default reduce using rule 7 (@2)
@2 go to state 18
State 16
9 exp: \"(\" exp \")\" .
\$default reduce using rule 9 (exp)
State 17
4 assignment: id \":=\" exp .
\$default reduce using rule 4 (assignment)
State 18
8 exp: . \"incr\" exp @1 @2 exp
8 | \"incr\" exp @1 @2 . exp
9 | . \"(\" exp \")\"
10 | . \"identifier\"
11 | . \"number\"
\"incr\" shift, and go to state 4
\"identifier\" shift, and go to state 11
\"number\" shift, and go to state 6
\"(\" shift, and go to state 7
exp go to state 19
State 19
8 exp: \"incr\" exp @1 @2 exp .
\$default reduce using rule 8 (exp)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:594: cat input.gv"
at_fn_check_prepare_trace "report.at:594"
( $at_check_trace; cat input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "// Generated by GNU Bison 3.8.2.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.
digraph \"input.yy\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • unit \\\"end of file\\\"\\l 1 unit: • assignments exp\\l 2 assignments: • %empty\\l 3 | • assignments assignment\\l\"]
0 -> 1 [style=dashed label=\"unit\"]
0 -> 2 [style=dashed label=\"assignments\"]
0 -> \"0R2\" [style=solid]
\"0R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
1 [label=\"State 1\\n\\l 0 \$accept: unit • \\\"end of file\\\"\\l\"]
1 -> 3 [style=solid label=\"\\\"end of file\\\"\"]
2 [label=\"State 2\\n\\l 1 unit: assignments • exp\\l 3 assignments: assignments • assignment\\l 4 assignment: • id \\\":=\\\" exp\\l 5 id: • \\\"identifier\\\"\\l 8 exp: • \\\"incr\\\" exp @1 @2 exp\\l 9 | • \\\"(\\\" exp \\\")\\\"\\l 10 | • \\\"identifier\\\"\\l 11 | • \\\"number\\\"\\l\"]
2 -> 4 [style=solid label=\"\\\"incr\\\"\"]
2 -> 5 [style=solid label=\"\\\"identifier\\\"\"]
2 -> 6 [style=solid label=\"\\\"number\\\"\"]
2 -> 7 [style=solid label=\"\\\"(\\\"\"]
2 -> 8 [style=dashed label=\"assignment\"]
2 -> 9 [style=dashed label=\"id\"]
2 -> 10 [style=dashed label=\"exp\"]
3 [label=\"State 3\\n\\l 0 \$accept: unit \\\"end of file\\\" •\\l\"]
3 -> \"3R0\" [style=solid]
\"3R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
4 [label=\"State 4\\n\\l 8 exp: • \\\"incr\\\" exp @1 @2 exp\\l 8 | \\\"incr\\\" • exp @1 @2 exp\\l 9 | • \\\"(\\\" exp \\\")\\\"\\l 10 | • \\\"identifier\\\"\\l 11 | • \\\"number\\\"\\l\"]
4 -> 4 [style=solid label=\"\\\"incr\\\"\"]
4 -> 11 [style=solid label=\"\\\"identifier\\\"\"]
4 -> 6 [style=solid label=\"\\\"number\\\"\"]
4 -> 7 [style=solid label=\"\\\"(\\\"\"]
4 -> 12 [style=dashed label=\"exp\"]
5 [label=\"State 5\\n\\l 5 id: \\\"identifier\\\" • [\\\":=\\\"]\\l 10 exp: \\\"identifier\\\" • [\\\"end of file\\\"]\\l\"]
5 -> \"5R5\" [style=solid]
\"5R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
5 -> \"5R10\" [label=\"[\\\"end of file\\\"]\", style=solid]
\"5R10\" [label=\"R10\", fillcolor=3, shape=diamond, style=filled]
6 [label=\"State 6\\n\\l 11 exp: \\\"number\\\" •\\l\"]
6 -> \"6R11\" [style=solid]
\"6R11\" [label=\"R11\", fillcolor=3, shape=diamond, style=filled]
7 [label=\"State 7\\n\\l 8 exp: • \\\"incr\\\" exp @1 @2 exp\\l 9 | • \\\"(\\\" exp \\\")\\\"\\l 9 | \\\"(\\\" • exp \\\")\\\"\\l 10 | • \\\"identifier\\\"\\l 11 | • \\\"number\\\"\\l\"]
7 -> 4 [style=solid label=\"\\\"incr\\\"\"]
7 -> 11 [style=solid label=\"\\\"identifier\\\"\"]
7 -> 6 [style=solid label=\"\\\"number\\\"\"]
7 -> 7 [style=solid label=\"\\\"(\\\"\"]
7 -> 13 [style=dashed label=\"exp\"]
8 [label=\"State 8\\n\\l 3 assignments: assignments assignment •\\l\"]
8 -> \"8R3\" [style=solid]
\"8R3\" [label=\"R3\", fillcolor=3, shape=diamond, style=filled]
9 [label=\"State 9\\n\\l 4 assignment: id • \\\":=\\\" exp\\l\"]
9 -> 14 [style=solid label=\"\\\":=\\\"\"]
10 [label=\"State 10\\n\\l 1 unit: assignments exp •\\l\"]
10 -> \"10R1\" [style=solid]
\"10R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
11 [label=\"State 11\\n\\l 10 exp: \\\"identifier\\\" •\\l\"]
11 -> \"11R10\" [style=solid]
\"11R10\" [label=\"R10\", fillcolor=3, shape=diamond, style=filled]
12 [label=\"State 12\\n\\l 6 @1: • %empty\\l 8 exp: \\\"incr\\\" exp • @1 @2 exp\\l\"]
12 -> 15 [style=dashed label=\"@1\"]
12 -> \"12R6\" [style=solid]
\"12R6\" [label=\"R6\", fillcolor=3, shape=diamond, style=filled]
13 [label=\"State 13\\n\\l 9 exp: \\\"(\\\" exp • \\\")\\\"\\l\"]
13 -> 16 [style=solid label=\"\\\")\\\"\"]
14 [label=\"State 14\\n\\l 4 assignment: id \\\":=\\\" • exp\\l 8 exp: • \\\"incr\\\" exp @1 @2 exp\\l 9 | • \\\"(\\\" exp \\\")\\\"\\l 10 | • \\\"identifier\\\"\\l 11 | • \\\"number\\\"\\l\"]
14 -> 4 [style=solid label=\"\\\"incr\\\"\"]
14 -> 11 [style=solid label=\"\\\"identifier\\\"\"]
14 -> 6 [style=solid label=\"\\\"number\\\"\"]
14 -> 7 [style=solid label=\"\\\"(\\\"\"]
14 -> 17 [style=dashed label=\"exp\"]
15 [label=\"State 15\\n\\l 7 @2: • %empty\\l 8 exp: \\\"incr\\\" exp @1 • @2 exp\\l\"]
15 -> 18 [style=dashed label=\"@2\"]
15 -> \"15R7\" [style=solid]
\"15R7\" [label=\"R7\", fillcolor=3, shape=diamond, style=filled]
16 [label=\"State 16\\n\\l 9 exp: \\\"(\\\" exp \\\")\\\" •\\l\"]
16 -> \"16R9\" [style=solid]
\"16R9\" [label=\"R9\", fillcolor=3, shape=diamond, style=filled]
17 [label=\"State 17\\n\\l 4 assignment: id \\\":=\\\" exp •\\l\"]
17 -> \"17R4\" [style=solid]
\"17R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
18 [label=\"State 18\\n\\l 8 exp: • \\\"incr\\\" exp @1 @2 exp\\l 8 | \\\"incr\\\" exp @1 @2 • exp\\l 9 | • \\\"(\\\" exp \\\")\\\"\\l 10 | • \\\"identifier\\\"\\l 11 | • \\\"number\\\"\\l\"]
18 -> 4 [style=solid label=\"\\\"incr\\\"\"]
18 -> 11 [style=solid label=\"\\\"identifier\\\"\"]
18 -> 6 [style=solid label=\"\\\"number\\\"\"]
18 -> 7 [style=solid label=\"\\\"(\\\"\"]
18 -> 19 [style=dashed label=\"exp\"]
19 [label=\"State 19\\n\\l 8 exp: \\\"incr\\\" exp @1 @2 exp •\\l\"]
19 -> \"19R8\" [style=solid]
\"19R8\" [label=\"R8\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:594"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:688: cat input.xml"
at_fn_check_prepare_trace "report.at:688"
( $at_check_trace; cat input.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "<?xml version=\"1.0\"?>
<bison-xml-report version=\"3.8.2\" bug-report=\"bug-bison@gnu.org\" url=\"https://www.gnu.org/software/bison/\">
<filename>input.yy</filename>
<grammar>
<rules>
<rule number=\"0\" usefulness=\"useful\">
<lhs>\$accept</lhs>
<rhs>
<symbol>unit</symbol>
<symbol>"end of file"</symbol>
</rhs>
</rule>
<rule number=\"1\" usefulness=\"useful\">
<lhs>unit</lhs>
<rhs>
<symbol>assignments</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"2\" usefulness=\"useful\">
<lhs>assignments</lhs>
<rhs>
<empty/>
</rhs>
</rule>
<rule number=\"3\" usefulness=\"useful\">
<lhs>assignments</lhs>
<rhs>
<symbol>assignments</symbol>
<symbol>assignment</symbol>
</rhs>
</rule>
<rule number=\"4\" usefulness=\"useful\">
<lhs>assignment</lhs>
<rhs>
<symbol>id</symbol>
<symbol>":="</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"5\" usefulness=\"useful\">
<lhs>id</lhs>
<rhs>
<symbol>"identifier"</symbol>
</rhs>
</rule>
<rule number=\"6\" usefulness=\"useful\">
<lhs>@1</lhs>
<rhs>
<empty/>
</rhs>
</rule>
<rule number=\"7\" usefulness=\"useful\">
<lhs>@2</lhs>
<rhs>
<empty/>
</rhs>
</rule>
<rule number=\"8\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"incr"</symbol>
<symbol>exp</symbol>
<symbol>@1</symbol>
<symbol>@2</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"9\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"("</symbol>
<symbol>exp</symbol>
<symbol>")"</symbol>
</rhs>
</rule>
<rule number=\"10\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"identifier"</symbol>
</rhs>
</rule>
<rule number=\"11\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"number"</symbol>
</rhs>
</rule>
</rules>
<terminals>
<terminal symbol-number=\"0\" token-number=\"0\" name=\""end of file"\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"1\" token-number=\"256\" name=\"error\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"3\" token-number=\"258\" name=\"":="\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"4\" token-number=\"259\" name=\""incr"\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"5\" token-number=\"260\" name=\""identifier"\" type=\"std::string\" usefulness=\"useful\"/>
<terminal symbol-number=\"6\" token-number=\"261\" name=\""number"\" type=\"int\" usefulness=\"useful\"/>
<terminal symbol-number=\"7\" token-number=\"262\" name=\""("\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"8\" token-number=\"263\" name=\"")"\" type=\"\" usefulness=\"useful\"/>
</terminals>
<nonterminals>
<nonterminal symbol-number=\"9\" name=\"\$accept\" type=\"\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"10\" name=\"unit\" type=\"\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"11\" name=\"assignments\" type=\"\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"12\" name=\"assignment\" type=\"\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"13\" name=\"id\" type=\"std::string\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"14\" name=\"exp\" type=\"int\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"15\" name=\"@1\" type=\"int\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"16\" name=\"@2\" type=\"int\" usefulness=\"useful\"/>
</nonterminals>
</grammar>
<automaton>
<state number=\"0\">
<itemset>
<item rule-number=\"0\" dot=\"0\"/>
<item rule-number=\"1\" dot=\"0\"/>
<item rule-number=\"2\" dot=\"0\"/>
<item rule-number=\"3\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"goto\" symbol=\"unit\" state=\"1\"/>
<transition type=\"goto\" symbol=\"assignments\" state=\"2\"/>
</transitions>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"2\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"1\">
<itemset>
<item rule-number=\"0\" dot=\"1\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""end of file"\" state=\"3\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"2\">
<itemset>
<item rule-number=\"1\" dot=\"1\"/>
<item rule-number=\"3\" dot=\"1\"/>
<item rule-number=\"4\" dot=\"0\"/>
<item rule-number=\"5\" dot=\"0\"/>
<item rule-number=\"8\" dot=\"0\"/>
<item rule-number=\"9\" dot=\"0\"/>
<item rule-number=\"10\" dot=\"0\"/>
<item rule-number=\"11\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""incr"\" state=\"4\"/>
<transition type=\"shift\" symbol=\""identifier"\" state=\"5\"/>
<transition type=\"shift\" symbol=\""number"\" state=\"6\"/>
<transition type=\"shift\" symbol=\""("\" state=\"7\"/>
<transition type=\"goto\" symbol=\"assignment\" state=\"8\"/>
<transition type=\"goto\" symbol=\"id\" state=\"9\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"10\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"3\">
<itemset>
<item rule-number=\"0\" dot=\"2\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"accept\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"4\">
<itemset>
<item rule-number=\"8\" dot=\"0\"/>
<item rule-number=\"8\" dot=\"1\"/>
<item rule-number=\"9\" dot=\"0\"/>
<item rule-number=\"10\" dot=\"0\"/>
<item rule-number=\"11\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""incr"\" state=\"4\"/>
<transition type=\"shift\" symbol=\""identifier"\" state=\"11\"/>
<transition type=\"shift\" symbol=\""number"\" state=\"6\"/>
<transition type=\"shift\" symbol=\""("\" state=\"7\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"12\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"5\">
<itemset>
<item rule-number=\"5\" dot=\"1\">
<lookaheads>
<symbol>":="</symbol>
</lookaheads>
</item>
<item rule-number=\"10\" dot=\"1\">
<lookaheads>
<symbol>"end of file"</symbol>
</lookaheads>
</item>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\""end of file"\" rule=\"10\" enabled=\"true\"/>
<reduction symbol=\"\$default\" rule=\"5\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"6\">
<itemset>
<item rule-number=\"11\" dot=\"1\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"11\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"7\">
<itemset>
<item rule-number=\"8\" dot=\"0\"/>
<item rule-number=\"9\" dot=\"0\"/>
<item rule-number=\"9\" dot=\"1\"/>
<item rule-number=\"10\" dot=\"0\"/>
<item rule-number=\"11\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""incr"\" state=\"4\"/>
<transition type=\"shift\" symbol=\""identifier"\" state=\"11\"/>
<transition type=\"shift\" symbol=\""number"\" state=\"6\"/>
<transition type=\"shift\" symbol=\""("\" state=\"7\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"13\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"8\">
<itemset>
<item rule-number=\"3\" dot=\"2\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"3\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"9\">
<itemset>
<item rule-number=\"4\" dot=\"1\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\"":="\" state=\"14\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"10\">
<itemset>
<item rule-number=\"1\" dot=\"2\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"1\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"11\">
<itemset>
<item rule-number=\"10\" dot=\"1\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"10\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"12\">
<itemset>
<item rule-number=\"6\" dot=\"0\"/>
<item rule-number=\"8\" dot=\"2\"/>
</itemset>
<actions>
<transitions>
<transition type=\"goto\" symbol=\"@1\" state=\"15\"/>
</transitions>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"6\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"13\">
<itemset>
<item rule-number=\"9\" dot=\"2\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\"")"\" state=\"16\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"14\">
<itemset>
<item rule-number=\"4\" dot=\"2\"/>
<item rule-number=\"8\" dot=\"0\"/>
<item rule-number=\"9\" dot=\"0\"/>
<item rule-number=\"10\" dot=\"0\"/>
<item rule-number=\"11\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""incr"\" state=\"4\"/>
<transition type=\"shift\" symbol=\""identifier"\" state=\"11\"/>
<transition type=\"shift\" symbol=\""number"\" state=\"6\"/>
<transition type=\"shift\" symbol=\""("\" state=\"7\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"17\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"15\">
<itemset>
<item rule-number=\"7\" dot=\"0\"/>
<item rule-number=\"8\" dot=\"3\"/>
</itemset>
<actions>
<transitions>
<transition type=\"goto\" symbol=\"@2\" state=\"18\"/>
</transitions>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"7\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"16\">
<itemset>
<item rule-number=\"9\" dot=\"3\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"9\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"17\">
<itemset>
<item rule-number=\"4\" dot=\"3\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"4\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"18\">
<itemset>
<item rule-number=\"8\" dot=\"0\"/>
<item rule-number=\"8\" dot=\"4\"/>
<item rule-number=\"9\" dot=\"0\"/>
<item rule-number=\"10\" dot=\"0\"/>
<item rule-number=\"11\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""incr"\" state=\"4\"/>
<transition type=\"shift\" symbol=\""identifier"\" state=\"11\"/>
<transition type=\"shift\" symbol=\""number"\" state=\"6\"/>
<transition type=\"shift\" symbol=\""("\" state=\"7\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"19\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"19\">
<itemset>
<item rule-number=\"8\" dot=\"5\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"8\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
</automaton>
</bison-xml-report>
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:688"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check HTML output.
{ set +x
printf "%s\n" "$at_srcdir/report.at:1156: sed -e 's|content=\"text/html; charset=UTF-8\"|content=\"text/html;charset=UTF-8\"|g' input.html"
at_fn_check_prepare_notrace 'a shell pipeline' "report.at:1156"
( $at_check_trace; sed -e 's|content="text/html; charset=UTF-8"|content="text/html;charset=UTF-8"|g' input.html
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:bison=\"https://www.gnu.org/software/bison/\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />
<title>input.yy - GNU Bison XML Automaton Report</title>
<style type=\"text/css\">
body {
font-family: \"Nimbus Sans L\", Arial, sans-serif;
font-size: 9pt;
}
a:link {
color: #1f00ff;
text-decoration: none;
}
a:visited {
color: #1f00ff;
text-decoration: none;
}
a:hover {
color: red;
}
#menu a {
text-decoration: underline;
}
.i {
font-style: italic;
}
.pre {
font-family: monospace;
white-space: pre;
}
ol.decimal {
list-style-type: decimal;
}
ol.lower-alpha {
list-style-type: lower-alpha;
}
.dot {
color: #cc0000;
}
#footer {
margin-top: 3.5em;
font-size: 7pt;
}
</style>
</head>
<body><h1>GNU Bison XML Automaton Report</h1><p>
input grammar: <span class=\"i\">input.yy</span></p>
<h3>Table of Contents</h3><ul id=\"menu\"><li><a href=\"#reductions\">Reductions</a><ul class=\"lower-alpha\"><li><a href=\"#nonterminals_useless_in_grammar\">Nonterminals useless in grammar</a></li><li><a href=\"#terminals_unused_in_grammar\">Terminals unused in grammar</a></li><li><a href=\"#rules_useless_in_grammar\">Rules useless in grammar</a></li></ul></li><li><a href=\"#conflicts\">Conflicts</a></li><li><a href=\"#grammar\">Grammar</a><ul class=\"lower-alpha\"><li><a href=\"#grammar\">Itemset</a></li><li><a href=\"#terminals\">Terminal symbols</a></li><li><a href=\"#nonterminals\">Nonterminal symbols</a></li></ul></li><li><a href=\"#automaton\">Automaton</a></li></ul><h2><a name=\"reductions\" id=\"reductions\"></a> Reductions</h2><h3><a name=\"nonterminals_useless_in_grammar\" id=\"nonterminals_useless_in_grammar\"></a> Nonterminals useless in grammar</h3>
<h3><a name=\"terminals_unused_in_grammar\" id=\"terminals_unused_in_grammar\"></a> Terminals unused in grammar</h3>
<h3><a name=\"rules_useless_in_grammar\" id=\"rules_useless_in_grammar\"></a> Rules useless in grammar</h3>
<h2><a name=\"conflicts\" id=\"conflicts\"></a> Conflicts</h2>
<h2><a name=\"grammar\" id=\"grammar\"></a> Grammar</h2>
<p class=\"pre\">
<a name=\"rule_0\" id=\"rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">unit</span> <b>\"end of file\"</b>
<a name=\"rule_1\" id=\"rule_1\"> 1</a> <span class=\"i\">unit</span> → <span class=\"i\">assignments</span> <span class=\"i\">exp</span>
<a name=\"rule_2\" id=\"rule_2\"> 2</a> <span class=\"i\">assignments</span> → %empty
<a name=\"rule_3\" id=\"rule_3\"> 3</a> | <span class=\"i\">assignments</span> <span class=\"i\">assignment</span>
<a name=\"rule_4\" id=\"rule_4\"> 4</a> <span class=\"i\">assignment</span> → <span class=\"i\">id</span> <b>\":=\"</b> <span class=\"i\">exp</span>
<a name=\"rule_5\" id=\"rule_5\"> 5</a> <span class=\"i\">id</span> → <b>\"identifier\"</b>
<a name=\"rule_6\" id=\"rule_6\"> 6</a> <span class=\"i\">@1</span> → %empty
<a name=\"rule_7\" id=\"rule_7\"> 7</a> <span class=\"i\">@2</span> → %empty
<a name=\"rule_8\" id=\"rule_8\"> 8</a> <span class=\"i\">exp</span> → <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a name=\"rule_9\" id=\"rule_9\"> 9</a> | <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a name=\"rule_10\" id=\"rule_10\"> 10</a> | <b>\"identifier\"</b>
<a name=\"rule_11\" id=\"rule_11\"> 11</a> | <b>\"number\"</b>
</p>
<h3><a name=\"terminals\" id=\"terminals\"></a> Terminals, with rules where they appear</h3>
<ul>
<li><b>\"end of file\"</b> (0) <a href=\"#rule_0\">0</a></li>
<li><b>error</b> (256)</li>
<li><b>\":=\"</b> (258) <a href=\"#rule_4\">4</a></li>
<li><b>\"incr\"</b> (259) <a href=\"#rule_8\">8</a></li>
<li><b>\"identifier\"</b> <std::string> (260) <a href=\"#rule_5\">5</a> <a href=\"#rule_10\">10</a></li>
<li><b>\"number\"</b> <int> (261) <a href=\"#rule_11\">11</a></li>
<li><b>\"(\"</b> (262) <a href=\"#rule_9\">9</a></li>
<li><b>\")\"</b> (263) <a href=\"#rule_9\">9</a></li>
</ul>
<h3><a name=\"nonterminals\" id=\"nonterminals\"></a> Nonterminals, with rules where they appear</h3>
<ul>
<li><b>\$accept</b> (9)
<ul>
<li>on left: <a href=\"#rule_0\">0</a></li>
</ul>
</li>
<li><b>unit</b> (10)
<ul>
<li>on left: <a href=\"#rule_1\">1</a></li>
<li>on right: <a href=\"#rule_0\">0</a></li>
</ul>
</li>
<li><b>assignments</b> (11)
<ul>
<li>on left: <a href=\"#rule_2\">2</a> <a href=\"#rule_3\">3</a></li>
<li>on right: <a href=\"#rule_1\">1</a> <a href=\"#rule_3\">3</a></li>
</ul>
</li>
<li><b>assignment</b> (12)
<ul>
<li>on left: <a href=\"#rule_4\">4</a></li>
<li>on right: <a href=\"#rule_3\">3</a></li>
</ul>
</li>
<li><b>id</b> <std::string> (13)
<ul>
<li>on left: <a href=\"#rule_5\">5</a></li>
<li>on right: <a href=\"#rule_4\">4</a></li>
</ul>
</li>
<li><b>exp</b> <int> (14)
<ul>
<li>on left: <a href=\"#rule_8\">8</a> <a href=\"#rule_9\">9</a> <a href=\"#rule_10\">10</a> <a href=\"#rule_11\">11</a></li>
<li>on right: <a href=\"#rule_1\">1</a> <a href=\"#rule_4\">4</a> <a href=\"#rule_8\">8</a> <a href=\"#rule_9\">9</a></li>
</ul>
</li>
<li><b>@1</b> <int> (15)
<ul>
<li>on left: <a href=\"#rule_6\">6</a></li>
<li>on right: <a href=\"#rule_8\">8</a></li>
</ul>
</li>
<li><b>@2</b> <int> (16)
<ul>
<li>on left: <a href=\"#rule_7\">7</a></li>
<li>on right: <a href=\"#rule_8\">8</a></li>
</ul>
</li>
</ul><h2><a name=\"automaton\" id=\"automaton\"></a> Automaton</h2>
<h3><a name=\"state_0\" id=\"state_0\"></a>State 0</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"dot\">•</span> <span class=\"i\">unit</span> <b>\"end of file\"</b>
<a href=\"#rule_1\"> 1</a> <span class=\"i\">unit</span> → <span class=\"dot\">•</span> <span class=\"i\">assignments</span> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> <span class=\"i\">assignments</span> → <span class=\"dot\">•</span> %empty
<a href=\"#rule_3\"> 3</a> | <span class=\"dot\">•</span> <span class=\"i\">assignments</span> <span class=\"i\">assignment</span>
\$default <a href=\"#rule_2\">reduce using rule 2</a> (assignments)
unit <a href=\"#state_1\">go to state 1</a>
assignments <a href=\"#state_2\">go to state 2</a>
</p>
<h3><a name=\"state_1\" id=\"state_1\"></a>State 1</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">unit</span> <span class=\"dot\">•</span> <b>\"end of file\"</b>
\"end of file\" <a href=\"#state_3\">shift, and go to state 3</a>
</p>
<h3><a name=\"state_2\" id=\"state_2\"></a>State 2</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">unit</span> → <span class=\"i\">assignments</span> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> <span class=\"i\">assignments</span> → <span class=\"i\">assignments</span> <span class=\"dot\">•</span> <span class=\"i\">assignment</span>
<a href=\"#rule_4\"> 4</a> <span class=\"i\">assignment</span> → <span class=\"dot\">•</span> <span class=\"i\">id</span> <b>\":=\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_5\"> 5</a> <span class=\"i\">id</span> → <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_9\"> 9</a> | <span class=\"dot\">•</span> <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_10\"> 10</a> | <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_11\"> 11</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
\"incr\" <a href=\"#state_4\">shift, and go to state 4</a>
\"identifier\" <a href=\"#state_5\">shift, and go to state 5</a>
\"number\" <a href=\"#state_6\">shift, and go to state 6</a>
\"(\" <a href=\"#state_7\">shift, and go to state 7</a>
assignment <a href=\"#state_8\">go to state 8</a>
id <a href=\"#state_9\">go to state 9</a>
exp <a href=\"#state_10\">go to state 10</a>
</p>
<h3><a name=\"state_3\" id=\"state_3\"></a>State 3</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">unit</span> <b>\"end of file\"</b> <span class=\"dot\">•</span>
\$default accept
</p>
<h3><a name=\"state_4\" id=\"state_4\"></a>State 4</h3>
<p class=\"pre\"> <a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_8\"> 8</a> | <b>\"incr\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_9\"> 9</a> | <span class=\"dot\">•</span> <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_10\"> 10</a> | <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_11\"> 11</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
\"incr\" <a href=\"#state_4\">shift, and go to state 4</a>
\"identifier\" <a href=\"#state_11\">shift, and go to state 11</a>
\"number\" <a href=\"#state_6\">shift, and go to state 6</a>
\"(\" <a href=\"#state_7\">shift, and go to state 7</a>
exp <a href=\"#state_12\">go to state 12</a>
</p>
<h3><a name=\"state_5\" id=\"state_5\"></a>State 5</h3>
<p class=\"pre\"> <a href=\"#rule_5\"> 5</a> <span class=\"i\">id</span> → <b>\"identifier\"</b> <span class=\"dot\">•</span> [\":=\"]
<a href=\"#rule_10\"> 10</a> <span class=\"i\">exp</span> → <b>\"identifier\"</b> <span class=\"dot\">•</span> [\"end of file\"]
\"end of file\" <a href=\"#rule_10\">reduce using rule 10</a> (exp)
\$default <a href=\"#rule_5\">reduce using rule 5</a> (id)
</p>
<h3><a name=\"state_6\" id=\"state_6\"></a>State 6</h3>
<p class=\"pre\"> <a href=\"#rule_11\"> 11</a> <span class=\"i\">exp</span> → <b>\"number\"</b> <span class=\"dot\">•</span>
\$default <a href=\"#rule_11\">reduce using rule 11</a> (exp)
</p>
<h3><a name=\"state_7\" id=\"state_7\"></a>State 7</h3>
<p class=\"pre\"> <a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_9\"> 9</a> | <span class=\"dot\">•</span> <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_9\"> 9</a> | <b>\"(\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_10\"> 10</a> | <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_11\"> 11</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
\"incr\" <a href=\"#state_4\">shift, and go to state 4</a>
\"identifier\" <a href=\"#state_11\">shift, and go to state 11</a>
\"number\" <a href=\"#state_6\">shift, and go to state 6</a>
\"(\" <a href=\"#state_7\">shift, and go to state 7</a>
exp <a href=\"#state_13\">go to state 13</a>
</p>
<h3><a name=\"state_8\" id=\"state_8\"></a>State 8</h3>
<p class=\"pre\"> <a href=\"#rule_3\"> 3</a> <span class=\"i\">assignments</span> → <span class=\"i\">assignments</span> <span class=\"i\">assignment</span> <span class=\"dot\">•</span>
\$default <a href=\"#rule_3\">reduce using rule 3</a> (assignments)
</p>
<h3><a name=\"state_9\" id=\"state_9\"></a>State 9</h3>
<p class=\"pre\"> <a href=\"#rule_4\"> 4</a> <span class=\"i\">assignment</span> → <span class=\"i\">id</span> <span class=\"dot\">•</span> <b>\":=\"</b> <span class=\"i\">exp</span>
\":=\" <a href=\"#state_14\">shift, and go to state 14</a>
</p>
<h3><a name=\"state_10\" id=\"state_10\"></a>State 10</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">unit</span> → <span class=\"i\">assignments</span> <span class=\"i\">exp</span> <span class=\"dot\">•</span>
\$default <a href=\"#rule_1\">reduce using rule 1</a> (unit)
</p>
<h3><a name=\"state_11\" id=\"state_11\"></a>State 11</h3>
<p class=\"pre\"> <a href=\"#rule_10\"> 10</a> <span class=\"i\">exp</span> → <b>\"identifier\"</b> <span class=\"dot\">•</span>
\$default <a href=\"#rule_10\">reduce using rule 10</a> (exp)
</p>
<h3><a name=\"state_12\" id=\"state_12\"></a>State 12</h3>
<p class=\"pre\"> <a href=\"#rule_6\"> 6</a> <span class=\"i\">@1</span> → <span class=\"dot\">•</span> %empty
<a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
\$default <a href=\"#rule_6\">reduce using rule 6</a> (@1)
@1 <a href=\"#state_15\">go to state 15</a>
</p>
<h3><a name=\"state_13\" id=\"state_13\"></a>State 13</h3>
<p class=\"pre\"> <a href=\"#rule_9\"> 9</a> <span class=\"i\">exp</span> → <b>\"(\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\")\"</b>
\")\" <a href=\"#state_16\">shift, and go to state 16</a>
</p>
<h3><a name=\"state_14\" id=\"state_14\"></a>State 14</h3>
<p class=\"pre\"> <a href=\"#rule_4\"> 4</a> <span class=\"i\">assignment</span> → <span class=\"i\">id</span> <b>\":=\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_9\"> 9</a> | <span class=\"dot\">•</span> <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_10\"> 10</a> | <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_11\"> 11</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
\"incr\" <a href=\"#state_4\">shift, and go to state 4</a>
\"identifier\" <a href=\"#state_11\">shift, and go to state 11</a>
\"number\" <a href=\"#state_6\">shift, and go to state 6</a>
\"(\" <a href=\"#state_7\">shift, and go to state 7</a>
exp <a href=\"#state_17\">go to state 17</a>
</p>
<h3><a name=\"state_15\" id=\"state_15\"></a>State 15</h3>
<p class=\"pre\"> <a href=\"#rule_7\"> 7</a> <span class=\"i\">@2</span> → <span class=\"dot\">•</span> %empty
<a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"dot\">•</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
\$default <a href=\"#rule_7\">reduce using rule 7</a> (@2)
@2 <a href=\"#state_18\">go to state 18</a>
</p>
<h3><a name=\"state_16\" id=\"state_16\"></a>State 16</h3>
<p class=\"pre\"> <a href=\"#rule_9\"> 9</a> <span class=\"i\">exp</span> → <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b> <span class=\"dot\">•</span>
\$default <a href=\"#rule_9\">reduce using rule 9</a> (exp)
</p>
<h3><a name=\"state_17\" id=\"state_17\"></a>State 17</h3>
<p class=\"pre\"> <a href=\"#rule_4\"> 4</a> <span class=\"i\">assignment</span> → <span class=\"i\">id</span> <b>\":=\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span>
\$default <a href=\"#rule_4\">reduce using rule 4</a> (assignment)
</p>
<h3><a name=\"state_18\" id=\"state_18\"></a>State 18</h3>
<p class=\"pre\"> <a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span>
<a href=\"#rule_8\"> 8</a> | <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_9\"> 9</a> | <span class=\"dot\">•</span> <b>\"(\"</b> <span class=\"i\">exp</span> <b>\")\"</b>
<a href=\"#rule_10\"> 10</a> | <span class=\"dot\">•</span> <b>\"identifier\"</b>
<a href=\"#rule_11\"> 11</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
\"incr\" <a href=\"#state_4\">shift, and go to state 4</a>
\"identifier\" <a href=\"#state_11\">shift, and go to state 11</a>
\"number\" <a href=\"#state_6\">shift, and go to state 6</a>
\"(\" <a href=\"#state_7\">shift, and go to state 7</a>
exp <a href=\"#state_19\">go to state 19</a>
</p>
<h3><a name=\"state_19\" id=\"state_19\"></a>State 19</h3>
<p class=\"pre\"> <a href=\"#rule_8\"> 8</a> <span class=\"i\">exp</span> → <b>\"incr\"</b> <span class=\"i\">exp</span> <span class=\"i\">@1</span> <span class=\"i\">@2</span> <span class=\"i\">exp</span> <span class=\"dot\">•</span>
\$default <a href=\"#rule_8\">reduce using rule 8</a> (exp)
</p>
<div id=\"footer\"><hr />This document was generated using
<a href=\"https://www.gnu.org/software/bison/\" title=\"GNU Bison\">
GNU Bison 3.8.2</a>
XML Automaton Report.<br />
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>
</html>
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:1156"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_202
#AT_START_203
at_fn_group_banner 203 'report.at:3123' \
"Reports with conflicts" " " 9
at_xfail=no
(
printf "%s\n" "203. $at_setup_line: testing $at_desc ..."
$at_traceon
# We need UTF-8 support for correct screen-width computation of UTF-8
# characters. Skip the test if not available.
locale=`locale -a | $EGREP '^en_US\.(UTF-8|utf8)$' | sed 1q`
printf "%s\n" "report.at:3130" >"$at_check_line_file"
(test x = x"$locale") \
&& at_fn_check_skip 77 "$at_srcdir/report.at:3130"
printf "%s\n" "report.at:3132" >"$at_check_line_file"
(test x"$XSLTPROC" = x) \
&& at_fn_check_skip 77 "$at_srcdir/report.at:3132"
cat >input.y <<'_ATEOF'
%left "+"
%%
exp
: exp "⊕" exp
| exp "+" exp
| exp "+" exp
| "number"
| "Ñùṃéℝô"
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/report.at:3146: LC_ALL=\"\$locale\" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --html --xml input.y"
at_fn_check_prepare_dynamic "LC_ALL=\"$locale\" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --html --xml input.y" "report.at:3146"
( $at_check_trace; LC_ALL="$locale" bison -fno-caret -o input.cc -rall -Wcex --graph=input.gv --html --xml input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 3 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: 3 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: shift/reduce conflict on token \"⊕\" [-Wcounterexamples]
Example: exp \"+\" exp • \"⊕\" exp
Shift derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 2: exp \"+\" exp •
input.y: warning: reduce/reduce conflict on tokens \$end, \"+\", \"⊕\" [-Wcounterexamples]
Example: exp \"+\" exp •
First reduce derivation
exp
↳ 2: exp \"+\" exp •
Second reduce derivation
exp
↳ 3: exp \"+\" exp •
input.y: warning: shift/reduce conflict on token \"⊕\" [-Wcounterexamples]
Example: exp \"+\" exp • \"⊕\" exp
Shift derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 3: exp \"+\" exp •
input.y: warning: shift/reduce conflict on token \"⊕\" [-Wcounterexamples]
Example: exp \"⊕\" exp • \"⊕\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 1: exp \"⊕\" exp •
input.y: warning: shift/reduce conflict on token \"+\" [-Wcounterexamples]
Example: exp \"⊕\" exp • \"+\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 2: exp • \"+\" exp
Reduce derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp \"⊕\" exp •
input.y: warning: shift/reduce conflict on token \"+\" [-Wcounterexamples]
Example: exp \"⊕\" exp • \"+\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 3: exp • \"+\" exp
Reduce derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp \"⊕\" exp •
input.y:6.3-13: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:3146"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the contents of the report.
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/report.at:3212: sed -e 's/ *\$//' input.output"
at_fn_check_prepare_dynamic "sed -e 's/ *$//' input.output" "report.at:3212"
( $at_check_trace; sed -e 's/ *$//' input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Rules useless in parser due to conflicts
3 exp: exp \"+\" exp
State 7 conflicts: 1 shift/reduce, 3 reduce/reduce
State 8 conflicts: 2 shift/reduce
Grammar
0 \$accept: exp \$end
1 exp: exp \"⊕\" exp
2 | exp \"+\" exp
3 | exp \"+\" exp
4 | \"number\"
5 | \"Ñùṃéℝô\"
Terminals, with rules where they appear
\$end (0) 0
error (256)
\"+\" (258) 2 3
\"⊕\" (259) 1
\"number\" (260) 4
\"Ñùṃéℝô\" (261) 5
Nonterminals, with rules where they appear
\$accept (7)
on left: 0
exp (8)
on left: 1 2 3 4 5
on right: 0 1 2 3
State 0
0 \$accept: • exp \$end
1 exp: • exp \"⊕\" exp
2 | • exp \"+\" exp
3 | • exp \"+\" exp
4 | • \"number\"
5 | • \"Ñùṃéℝô\"
\"number\" shift, and go to state 1
\"Ñùṃéℝô\" shift, and go to state 2
exp go to state 3
State 1
4 exp: \"number\" •
\$default reduce using rule 4 (exp)
State 2
5 exp: \"Ñùṃéℝô\" •
\$default reduce using rule 5 (exp)
State 3
0 \$accept: exp • \$end
1 exp: exp • \"⊕\" exp
2 | exp • \"+\" exp
3 | exp • \"+\" exp
\$end shift, and go to state 4
\"+\" shift, and go to state 5
\"⊕\" shift, and go to state 6
State 4
0 \$accept: exp \$end •
\$default accept
State 5
1 exp: • exp \"⊕\" exp
2 | • exp \"+\" exp
2 | exp \"+\" • exp
3 | • exp \"+\" exp
3 | exp \"+\" • exp
4 | • \"number\"
5 | • \"Ñùṃéℝô\"
\"number\" shift, and go to state 1
\"Ñùṃéℝô\" shift, and go to state 2
exp go to state 7
State 6
1 exp: • exp \"⊕\" exp
1 | exp \"⊕\" • exp
2 | • exp \"+\" exp
3 | • exp \"+\" exp
4 | • \"number\"
5 | • \"Ñùṃéℝô\"
\"number\" shift, and go to state 1
\"Ñùṃéℝô\" shift, and go to state 2
exp go to state 8
State 7
1 exp: exp • \"⊕\" exp
2 | exp • \"+\" exp
2 | exp \"+\" exp • [\$end, \"+\", \"⊕\"]
3 | exp • \"+\" exp
3 | exp \"+\" exp • [\$end, \"+\", \"⊕\"]
\"⊕\" shift, and go to state 6
\$end reduce using rule 2 (exp)
\$end [reduce using rule 3 (exp)]
\"+\" reduce using rule 2 (exp)
\"+\" [reduce using rule 3 (exp)]
\"⊕\" [reduce using rule 2 (exp)]
\"⊕\" [reduce using rule 3 (exp)]
\$default reduce using rule 2 (exp)
Conflict between rule 2 and token \"+\" resolved as reduce (%left \"+\").
shift/reduce conflict on token \"⊕\":
2 exp: exp \"+\" exp •
1 exp: exp • \"⊕\" exp
Example: exp \"+\" exp • \"⊕\" exp
Shift derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 2: exp \"+\" exp •
reduce/reduce conflict on tokens \$end, \"+\", \"⊕\":
2 exp: exp \"+\" exp •
3 exp: exp \"+\" exp •
Example: exp \"+\" exp •
First reduce derivation
exp
↳ 2: exp \"+\" exp •
Second reduce derivation
exp
↳ 3: exp \"+\" exp •
shift/reduce conflict on token \"⊕\":
3 exp: exp \"+\" exp •
1 exp: exp • \"⊕\" exp
Example: exp \"+\" exp • \"⊕\" exp
Shift derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 3: exp \"+\" exp •
State 8
1 exp: exp • \"⊕\" exp
1 | exp \"⊕\" exp • [\$end, \"+\", \"⊕\"]
2 | exp • \"+\" exp
3 | exp • \"+\" exp
\"+\" shift, and go to state 5
\"⊕\" shift, and go to state 6
\"+\" [reduce using rule 1 (exp)]
\"⊕\" [reduce using rule 1 (exp)]
\$default reduce using rule 1 (exp)
shift/reduce conflict on token \"⊕\":
1 exp: exp \"⊕\" exp •
1 exp: exp • \"⊕\" exp
Example: exp \"⊕\" exp • \"⊕\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 1: exp • \"⊕\" exp
Reduce derivation
exp
↳ 1: exp \"⊕\" exp
↳ 1: exp \"⊕\" exp •
shift/reduce conflict on token \"+\":
1 exp: exp \"⊕\" exp •
2 exp: exp • \"+\" exp
Example: exp \"⊕\" exp • \"+\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 2: exp • \"+\" exp
Reduce derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp \"⊕\" exp •
shift/reduce conflict on token \"+\":
1 exp: exp \"⊕\" exp •
3 exp: exp • \"+\" exp
Example: exp \"⊕\" exp • \"+\" exp
Shift derivation
exp
↳ 1: exp \"⊕\" exp
↳ 3: exp • \"+\" exp
Reduce derivation
exp
↳ 2: exp \"+\" exp
↳ 1: exp \"⊕\" exp •
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:3212"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:3448: cat input.gv"
at_fn_check_prepare_trace "report.at:3448"
( $at_check_trace; cat input.gv
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "// Generated by GNU Bison 3.8.2.
// Report bugs to <bug-bison@gnu.org>.
// Home page: <https://www.gnu.org/software/bison/>.
digraph \"input.y\"
{
node [fontname = courier, shape = box, colorscheme = paired6]
edge [fontname = courier]
0 [label=\"State 0\\n\\l 0 \$accept: • exp \$end\\l 1 exp: • exp \\\"⊕\\\" exp\\l 2 | • exp \\\"+\\\" exp\\l 3 | • exp \\\"+\\\" exp\\l 4 | • \\\"number\\\"\\l 5 | • \\\"Ñùṃéℝô\\\"\\l\"]
0 -> 1 [style=solid label=\"\\\"number\\\"\"]
0 -> 2 [style=solid label=\"\\\"Ñùṃéℝô\\\"\"]
0 -> 3 [style=dashed label=\"exp\"]
1 [label=\"State 1\\n\\l 4 exp: \\\"number\\\" •\\l\"]
1 -> \"1R4\" [style=solid]
\"1R4\" [label=\"R4\", fillcolor=3, shape=diamond, style=filled]
2 [label=\"State 2\\n\\l 5 exp: \\\"Ñùṃéℝô\\\" •\\l\"]
2 -> \"2R5\" [style=solid]
\"2R5\" [label=\"R5\", fillcolor=3, shape=diamond, style=filled]
3 [label=\"State 3\\n\\l 0 \$accept: exp • \$end\\l 1 exp: exp • \\\"⊕\\\" exp\\l 2 | exp • \\\"+\\\" exp\\l 3 | exp • \\\"+\\\" exp\\l\"]
3 -> 4 [style=solid label=\"\$end\"]
3 -> 5 [style=solid label=\"\\\"+\\\"\"]
3 -> 6 [style=solid label=\"\\\"⊕\\\"\"]
4 [label=\"State 4\\n\\l 0 \$accept: exp \$end •\\l\"]
4 -> \"4R0\" [style=solid]
\"4R0\" [label=\"Acc\", fillcolor=1, shape=diamond, style=filled]
5 [label=\"State 5\\n\\l 1 exp: • exp \\\"⊕\\\" exp\\l 2 | • exp \\\"+\\\" exp\\l 2 | exp \\\"+\\\" • exp\\l 3 | • exp \\\"+\\\" exp\\l 3 | exp \\\"+\\\" • exp\\l 4 | • \\\"number\\\"\\l 5 | • \\\"Ñùṃéℝô\\\"\\l\"]
5 -> 1 [style=solid label=\"\\\"number\\\"\"]
5 -> 2 [style=solid label=\"\\\"Ñùṃéℝô\\\"\"]
5 -> 7 [style=dashed label=\"exp\"]
6 [label=\"State 6\\n\\l 1 exp: • exp \\\"⊕\\\" exp\\l 1 | exp \\\"⊕\\\" • exp\\l 2 | • exp \\\"+\\\" exp\\l 3 | • exp \\\"+\\\" exp\\l 4 | • \\\"number\\\"\\l 5 | • \\\"Ñùṃéℝô\\\"\\l\"]
6 -> 1 [style=solid label=\"\\\"number\\\"\"]
6 -> 2 [style=solid label=\"\\\"Ñùṃéℝô\\\"\"]
6 -> 8 [style=dashed label=\"exp\"]
7 [label=\"State 7\\n\\l 1 exp: exp • \\\"⊕\\\" exp\\l 2 | exp • \\\"+\\\" exp\\l 2 | exp \\\"+\\\" exp • [\$end, \\\"+\\\", \\\"⊕\\\"]\\l 3 | exp • \\\"+\\\" exp\\l 3 | exp \\\"+\\\" exp • [\$end, \\\"+\\\", \\\"⊕\\\"]\\l\"]
7 -> 6 [style=solid label=\"\\\"⊕\\\"\"]
7 -> \"7R2d\" [label=\"[\\\"⊕\\\"]\", style=solid]
\"7R2d\" [label=\"R2\", fillcolor=5, shape=diamond, style=filled]
7 -> \"7R2\" [style=solid]
\"7R2\" [label=\"R2\", fillcolor=3, shape=diamond, style=filled]
7 -> \"7R3d\" [label=\"[\$end, \\\"+\\\", \\\"⊕\\\"]\", style=solid]
\"7R3d\" [label=\"R3\", fillcolor=5, shape=diamond, style=filled]
8 [label=\"State 8\\n\\l 1 exp: exp • \\\"⊕\\\" exp\\l 1 | exp \\\"⊕\\\" exp • [\$end, \\\"+\\\", \\\"⊕\\\"]\\l 2 | exp • \\\"+\\\" exp\\l 3 | exp • \\\"+\\\" exp\\l\"]
8 -> 5 [style=solid label=\"\\\"+\\\"\"]
8 -> 6 [style=solid label=\"\\\"⊕\\\"\"]
8 -> \"8R1d\" [label=\"[\\\"+\\\", \\\"⊕\\\"]\", style=solid]
\"8R1d\" [label=\"R1\", fillcolor=5, shape=diamond, style=filled]
8 -> \"8R1\" [style=solid]
\"8R1\" [label=\"R1\", fillcolor=3, shape=diamond, style=filled]
}
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:3448"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:3502: cat input.xml"
at_fn_check_prepare_trace "report.at:3502"
( $at_check_trace; cat input.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "<?xml version=\"1.0\"?>
<bison-xml-report version=\"3.8.2\" bug-report=\"bug-bison@gnu.org\" url=\"https://www.gnu.org/software/bison/\">
<filename>input.y</filename>
<grammar>
<rules>
<rule number=\"0\" usefulness=\"useful\">
<lhs>\$accept</lhs>
<rhs>
<symbol>exp</symbol>
<symbol>\$end</symbol>
</rhs>
</rule>
<rule number=\"1\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>exp</symbol>
<symbol>"⊕"</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"2\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>exp</symbol>
<symbol>"+"</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"3\" usefulness=\"useless-in-parser\">
<lhs>exp</lhs>
<rhs>
<symbol>exp</symbol>
<symbol>"+"</symbol>
<symbol>exp</symbol>
</rhs>
</rule>
<rule number=\"4\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"number"</symbol>
</rhs>
</rule>
<rule number=\"5\" usefulness=\"useful\">
<lhs>exp</lhs>
<rhs>
<symbol>"Ñùṃéℝô"</symbol>
</rhs>
</rule>
</rules>
<terminals>
<terminal symbol-number=\"0\" token-number=\"0\" name=\"\$end\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"1\" token-number=\"256\" name=\"error\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"3\" token-number=\"258\" name=\""+"\" type=\"\" usefulness=\"useful\" prec=\"1\" assoc=\"left\"/>
<terminal symbol-number=\"4\" token-number=\"259\" name=\""⊕"\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"5\" token-number=\"260\" name=\""number"\" type=\"\" usefulness=\"useful\"/>
<terminal symbol-number=\"6\" token-number=\"261\" name=\""Ñùṃéℝô"\" type=\"\" usefulness=\"useful\"/>
</terminals>
<nonterminals>
<nonterminal symbol-number=\"7\" name=\"\$accept\" type=\"\" usefulness=\"useful\"/>
<nonterminal symbol-number=\"8\" name=\"exp\" type=\"\" usefulness=\"useful\"/>
</nonterminals>
</grammar>
<automaton>
<state number=\"0\">
<itemset>
<item rule-number=\"0\" dot=\"0\"/>
<item rule-number=\"1\" dot=\"0\"/>
<item rule-number=\"2\" dot=\"0\"/>
<item rule-number=\"3\" dot=\"0\"/>
<item rule-number=\"4\" dot=\"0\"/>
<item rule-number=\"5\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""number"\" state=\"1\"/>
<transition type=\"shift\" symbol=\""Ñùṃéℝô"\" state=\"2\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"3\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"1\">
<itemset>
<item rule-number=\"4\" dot=\"1\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"4\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"2\">
<itemset>
<item rule-number=\"5\" dot=\"1\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"5\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"3\">
<itemset>
<item rule-number=\"0\" dot=\"1\"/>
<item rule-number=\"1\" dot=\"1\"/>
<item rule-number=\"2\" dot=\"1\"/>
<item rule-number=\"3\" dot=\"1\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\"\$end\" state=\"4\"/>
<transition type=\"shift\" symbol=\""+"\" state=\"5\"/>
<transition type=\"shift\" symbol=\""⊕"\" state=\"6\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"4\">
<itemset>
<item rule-number=\"0\" dot=\"2\"/>
</itemset>
<actions>
<transitions/>
<errors/>
<reductions>
<reduction symbol=\"\$default\" rule=\"accept\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
<state number=\"5\">
<itemset>
<item rule-number=\"1\" dot=\"0\"/>
<item rule-number=\"2\" dot=\"0\"/>
<item rule-number=\"2\" dot=\"2\"/>
<item rule-number=\"3\" dot=\"0\"/>
<item rule-number=\"3\" dot=\"2\"/>
<item rule-number=\"4\" dot=\"0\"/>
<item rule-number=\"5\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""number"\" state=\"1\"/>
<transition type=\"shift\" symbol=\""Ñùṃéℝô"\" state=\"2\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"7\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"6\">
<itemset>
<item rule-number=\"1\" dot=\"0\"/>
<item rule-number=\"1\" dot=\"2\"/>
<item rule-number=\"2\" dot=\"0\"/>
<item rule-number=\"3\" dot=\"0\"/>
<item rule-number=\"4\" dot=\"0\"/>
<item rule-number=\"5\" dot=\"0\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""number"\" state=\"1\"/>
<transition type=\"shift\" symbol=\""Ñùṃéℝô"\" state=\"2\"/>
<transition type=\"goto\" symbol=\"exp\" state=\"8\"/>
</transitions>
<errors/>
<reductions/>
</actions>
<solved-conflicts/>
</state>
<state number=\"7\">
<itemset>
<item rule-number=\"1\" dot=\"1\"/>
<item rule-number=\"2\" dot=\"1\"/>
<item rule-number=\"2\" dot=\"3\">
<lookaheads>
<symbol>\$end</symbol>
<symbol>"+"</symbol>
<symbol>"⊕"</symbol>
</lookaheads>
</item>
<item rule-number=\"3\" dot=\"1\"/>
<item rule-number=\"3\" dot=\"3\">
<lookaheads>
<symbol>\$end</symbol>
<symbol>"+"</symbol>
<symbol>"⊕"</symbol>
</lookaheads>
</item>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""⊕"\" state=\"6\"/>
</transitions>
<errors/>
<reductions>
<reduction symbol=\"\$end\" rule=\"2\" enabled=\"true\"/>
<reduction symbol=\"\$end\" rule=\"3\" enabled=\"false\"/>
<reduction symbol=\""+"\" rule=\"2\" enabled=\"true\"/>
<reduction symbol=\""+"\" rule=\"3\" enabled=\"false\"/>
<reduction symbol=\""⊕"\" rule=\"2\" enabled=\"false\"/>
<reduction symbol=\""⊕"\" rule=\"3\" enabled=\"false\"/>
<reduction symbol=\"\$default\" rule=\"2\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts>
<resolution rule=\"2\" symbol=\""+"\" type=\"reduce\">%left "+"</resolution>
</solved-conflicts>
</state>
<state number=\"8\">
<itemset>
<item rule-number=\"1\" dot=\"1\"/>
<item rule-number=\"1\" dot=\"3\">
<lookaheads>
<symbol>\$end</symbol>
<symbol>"+"</symbol>
<symbol>"⊕"</symbol>
</lookaheads>
</item>
<item rule-number=\"2\" dot=\"1\"/>
<item rule-number=\"3\" dot=\"1\"/>
</itemset>
<actions>
<transitions>
<transition type=\"shift\" symbol=\""+"\" state=\"5\"/>
<transition type=\"shift\" symbol=\""⊕"\" state=\"6\"/>
</transitions>
<errors/>
<reductions>
<reduction symbol=\""+"\" rule=\"1\" enabled=\"false\"/>
<reduction symbol=\""⊕"\" rule=\"1\" enabled=\"false\"/>
<reduction symbol=\"\$default\" rule=\"1\" enabled=\"true\"/>
</reductions>
</actions>
<solved-conflicts/>
</state>
</automaton>
</bison-xml-report>
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:3502"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/report.at:3768: sed -e 's|content=\"text/html; charset=UTF-8\"|content=\"text/html;charset=UTF-8\"|g' input.html"
at_fn_check_prepare_notrace 'a shell pipeline' "report.at:3768"
( $at_check_trace; sed -e 's|content="text/html; charset=UTF-8"|content="text/html;charset=UTF-8"|g' input.html
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">
<html xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:bison=\"https://www.gnu.org/software/bison/\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html;charset=UTF-8\" />
<title>input.y - GNU Bison XML Automaton Report</title>
<style type=\"text/css\">
body {
font-family: \"Nimbus Sans L\", Arial, sans-serif;
font-size: 9pt;
}
a:link {
color: #1f00ff;
text-decoration: none;
}
a:visited {
color: #1f00ff;
text-decoration: none;
}
a:hover {
color: red;
}
#menu a {
text-decoration: underline;
}
.i {
font-style: italic;
}
.pre {
font-family: monospace;
white-space: pre;
}
ol.decimal {
list-style-type: decimal;
}
ol.lower-alpha {
list-style-type: lower-alpha;
}
.dot {
color: #cc0000;
}
#footer {
margin-top: 3.5em;
font-size: 7pt;
}
</style>
</head>
<body><h1>GNU Bison XML Automaton Report</h1><p>
input grammar: <span class=\"i\">input.y</span></p>
<h3>Table of Contents</h3><ul id=\"menu\"><li><a href=\"#reductions\">Reductions</a><ul class=\"lower-alpha\"><li><a href=\"#nonterminals_useless_in_grammar\">Nonterminals useless in grammar</a></li><li><a href=\"#terminals_unused_in_grammar\">Terminals unused in grammar</a></li><li><a href=\"#rules_useless_in_grammar\">Rules useless in grammar</a></li><li><a href=\"#rules_useless_in_parser\">Rules useless in parser due to conflicts</a></li></ul></li><li><a href=\"#conflicts\">Conflicts</a></li><li><a href=\"#grammar\">Grammar</a><ul class=\"lower-alpha\"><li><a href=\"#grammar\">Itemset</a></li><li><a href=\"#terminals\">Terminal symbols</a></li><li><a href=\"#nonterminals\">Nonterminal symbols</a></li></ul></li><li><a href=\"#automaton\">Automaton</a></li></ul><h2><a name=\"reductions\" id=\"reductions\"></a> Reductions</h2><h3><a name=\"nonterminals_useless_in_grammar\" id=\"nonterminals_useless_in_grammar\"></a> Nonterminals useless in grammar</h3>
<h3><a name=\"terminals_unused_in_grammar\" id=\"terminals_unused_in_grammar\"></a> Terminals unused in grammar</h3>
<h3><a name=\"rules_useless_in_grammar\" id=\"rules_useless_in_grammar\"></a> Rules useless in grammar</h3>
<h2><a name=\"rules_useless_in_parser\" id=\"rules_useless_in_parser\"></a> Rules useless in parser due to conflicts</h2>
<p class=\"pre\">
<a href=\"#rule_3\"> 3</a> <span class=\"i\">exp</span> → <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
</p>
<h2><a name=\"conflicts\" id=\"conflicts\"></a> Conflicts</h2>
<p class=\"pre\"><a href=\"#state_7\">State 7</a> conflicts: 1 shift/reduce, 3 reduce/reduce
<a href=\"#state_8\">State 8</a> conflicts: 2 shift/reduce
</p><h2><a name=\"grammar\" id=\"grammar\"></a> Grammar</h2>
<p class=\"pre\">
<a name=\"rule_0\" id=\"rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">exp</span> <b>\$end</b>
<a name=\"rule_1\" id=\"rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a name=\"rule_2\" id=\"rule_2\"> 2</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a name=\"rule_3\" id=\"rule_3\"> 3</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a name=\"rule_4\" id=\"rule_4\"> 4</a> | <b>\"number\"</b>
<a name=\"rule_5\" id=\"rule_5\"> 5</a> | <b>\"Ñùṃéℝô\"</b>
</p>
<h3><a name=\"terminals\" id=\"terminals\"></a> Terminals, with rules where they appear</h3>
<ul>
<li><b>\$end</b> (0) <a href=\"#rule_0\">0</a></li>
<li><b>error</b> (256)</li>
<li><b>\"+\"</b> (258) <a href=\"#rule_2\">2</a> <a href=\"#rule_3\">3</a></li>
<li><b>\"⊕\"</b> (259) <a href=\"#rule_1\">1</a></li>
<li><b>\"number\"</b> (260) <a href=\"#rule_4\">4</a></li>
<li><b>\"Ñùṃéℝô\"</b> (261) <a href=\"#rule_5\">5</a></li>
</ul>
<h3><a name=\"nonterminals\" id=\"nonterminals\"></a> Nonterminals, with rules where they appear</h3>
<ul>
<li><b>\$accept</b> (7)
<ul>
<li>on left: <a href=\"#rule_0\">0</a></li>
</ul>
</li>
<li><b>exp</b> (8)
<ul>
<li>on left: <a href=\"#rule_1\">1</a> <a href=\"#rule_2\">2</a> <a href=\"#rule_3\">3</a> <a href=\"#rule_4\">4</a> <a href=\"#rule_5\">5</a></li>
<li>on right: <a href=\"#rule_0\">0</a> <a href=\"#rule_1\">1</a> <a href=\"#rule_2\">2</a> <a href=\"#rule_3\">3</a></li>
</ul>
</li>
</ul><h2><a name=\"automaton\" id=\"automaton\"></a> Automaton</h2>
<h3><a name=\"state_0\" id=\"state_0\"></a>State 0</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\$end</b>
<a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_4\"> 4</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
<a href=\"#rule_5\"> 5</a> | <span class=\"dot\">•</span> <b>\"Ñùṃéℝô\"</b>
\"number\" <a href=\"#state_1\">shift, and go to state 1</a>
\"Ñùṃéℝô\" <a href=\"#state_2\">shift, and go to state 2</a>
exp <a href=\"#state_3\">go to state 3</a>
</p>
<h3><a name=\"state_1\" id=\"state_1\"></a>State 1</h3>
<p class=\"pre\"> <a href=\"#rule_4\"> 4</a> <span class=\"i\">exp</span> → <b>\"number\"</b> <span class=\"dot\">•</span>
\$default <a href=\"#rule_4\">reduce using rule 4</a> (exp)
</p>
<h3><a name=\"state_2\" id=\"state_2\"></a>State 2</h3>
<p class=\"pre\"> <a href=\"#rule_5\"> 5</a> <span class=\"i\">exp</span> → <b>\"Ñùṃéℝô\"</b> <span class=\"dot\">•</span>
\$default <a href=\"#rule_5\">reduce using rule 5</a> (exp)
</p>
<h3><a name=\"state_3\" id=\"state_3\"></a>State 3</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\$end</b>
<a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
\$end <a href=\"#state_4\">shift, and go to state 4</a>
\"+\" <a href=\"#state_5\">shift, and go to state 5</a>
\"⊕\" <a href=\"#state_6\">shift, and go to state 6</a>
</p>
<h3><a name=\"state_4\" id=\"state_4\"></a>State 4</h3>
<p class=\"pre\"> <a href=\"#rule_0\"> 0</a> <span class=\"i\">\$accept</span> → <span class=\"i\">exp</span> <b>\$end</b> <span class=\"dot\">•</span>
\$default accept
</p>
<h3><a name=\"state_5\" id=\"state_5\"></a>State 5</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_4\"> 4</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
<a href=\"#rule_5\"> 5</a> | <span class=\"dot\">•</span> <b>\"Ñùṃéℝô\"</b>
\"number\" <a href=\"#state_1\">shift, and go to state 1</a>
\"Ñùṃéℝô\" <a href=\"#state_2\">shift, and go to state 2</a>
exp <a href=\"#state_7\">go to state 7</a>
</p>
<h3><a name=\"state_6\" id=\"state_6\"></a>State 6</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_1\"> 1</a> | <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"dot\">•</span> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"dot\">•</span> <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_4\"> 4</a> | <span class=\"dot\">•</span> <b>\"number\"</b>
<a href=\"#rule_5\"> 5</a> | <span class=\"dot\">•</span> <b>\"Ñùṃéℝô\"</b>
\"number\" <a href=\"#state_1\">shift, and go to state 1</a>
\"Ñùṃéℝô\" <a href=\"#state_2\">shift, and go to state 2</a>
exp <a href=\"#state_8\">go to state 8</a>
</p>
<h3><a name=\"state_7\" id=\"state_7\"></a>State 7</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_2\"> 2</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span> [\$end, \"+\", \"⊕\"]
<a href=\"#rule_3\"> 3</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"i\">exp</span> <b>\"+\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span> [\$end, \"+\", \"⊕\"]
\"⊕\" <a href=\"#state_6\">shift, and go to state 6</a>
\$end <a href=\"#rule_2\">reduce using rule 2</a> (exp)
\$end [<a href=\"#rule_3\">reduce using rule 3</a> (exp)]
\"+\" <a href=\"#rule_2\">reduce using rule 2</a> (exp)
\"+\" [<a href=\"#rule_3\">reduce using rule 3</a> (exp)]
\"⊕\" [<a href=\"#rule_2\">reduce using rule 2</a> (exp)]
\"⊕\" [<a href=\"#rule_3\">reduce using rule 3</a> (exp)]
\$default <a href=\"#rule_2\">reduce using rule 2</a> (exp)
Conflict between <a href=\"#rule_2\">rule 2</a> and token \"+\" resolved as reduce (%left \"+\").
</p>
<h3><a name=\"state_8\" id=\"state_8\"></a>State 8</h3>
<p class=\"pre\"> <a href=\"#rule_1\"> 1</a> <span class=\"i\">exp</span> → <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"⊕\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_1\"> 1</a> | <span class=\"i\">exp</span> <b>\"⊕\"</b> <span class=\"i\">exp</span> <span class=\"dot\">•</span> [\$end, \"+\", \"⊕\"]
<a href=\"#rule_2\"> 2</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
<a href=\"#rule_3\"> 3</a> | <span class=\"i\">exp</span> <span class=\"dot\">•</span> <b>\"+\"</b> <span class=\"i\">exp</span>
\"+\" <a href=\"#state_5\">shift, and go to state 5</a>
\"⊕\" <a href=\"#state_6\">shift, and go to state 6</a>
\"+\" [<a href=\"#rule_1\">reduce using rule 1</a> (exp)]
\"⊕\" [<a href=\"#rule_1\">reduce using rule 1</a> (exp)]
\$default <a href=\"#rule_1\">reduce using rule 1</a> (exp)
</p>
<div id=\"footer\"><hr />This document was generated using
<a href=\"https://www.gnu.org/software/bison/\" title=\"GNU Bison\">
GNU Bison 3.8.2</a>
XML Automaton Report.<br />
Verbatim copying and distribution of this entire page is
permitted in any medium, provided this notice is preserved.</div></body>
</html>
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/report.at:3768"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_203
#AT_START_204
at_fn_group_banner 204 'conflicts.at:28' \
"Token declaration order" " " 10
at_xfail=no
(
printf "%s\n" "204. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%token A B C
%token D
%right E F G
%right H I
%right J
%left K
%left L M N
%nonassoc O P Q
%precedence R S T U
%precedence V W
%%
exp: A
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
int main (void)
{
assert (A < B);
assert (B < C);
assert (C < D);
assert (D < E);
assert (E < F);
assert (F < G);
assert (G < H);
assert (H < I);
assert (I < J);
assert (J < K);
assert (K < L);
assert (L < M);
assert (M < N);
assert (N < O);
assert (O < P);
assert (P < Q);
assert (Q < R);
assert (R < S);
assert (S < T);
assert (T < U);
assert (U < V);
assert (V < W);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:81"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:81"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:81"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:81: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:81"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:81"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:82" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:82"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:82: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:82"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:82"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:84: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:84"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:84: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:84"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:84"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_204
#AT_START_205
at_fn_group_banner 205 'conflicts.at:101' \
"Token declaration order: literals vs. identifiers" "" 10
at_xfail=no
(
printf "%s\n" "205. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%token 'a' 'b' C D
%token E F 'g' 'h'
%right 'i' 'j' K L
%right M N 'o' 'p'
%%
exp: 'a'
| 'b'
| C
| D
| E
| F
| 'g'
| 'h'
| 'i'
| 'j'
| K
| L
| M
| N
| 'o'
| 'p'
;
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:130"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:130"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:130"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:130"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:130"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:130: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:130"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:130"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:131: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:131"
( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . exp \$end
1 exp: . 'a'
2 | . 'b'
3 | . C
4 | . D
5 | . E
6 | . F
7 | . 'g'
8 | . 'h'
9 | . 'i'
10 | . 'j'
11 | . K
12 | . L
13 | . M
14 | . N
15 | . 'o'
16 | . 'p'
'a' shift, and go to state 1
'b' shift, and go to state 2
C shift, and go to state 3
D shift, and go to state 4
E shift, and go to state 5
F shift, and go to state 6
'g' shift, and go to state 7
'h' shift, and go to state 8
'i' shift, and go to state 9
'j' shift, and go to state 10
K shift, and go to state 11
L shift, and go to state 12
M shift, and go to state 13
N shift, and go to state 14
'o' shift, and go to state 15
'p' shift, and go to state 16
exp go to state 17
State 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:131"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_205
#AT_START_206
at_fn_group_banner 206 'conflicts.at:183' \
"Useless associativity warning" " " 10
at_xfail=no
(
printf "%s\n" "206. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token EQ "=" PL "+" ST "*" LP "("
%nonassoc "="
%left "+"
%left "*"
%precedence "("
%%
stmt:
exp
| "var" "=" exp
;
exp:
exp "+" exp
| exp "*" "num"
| "(" exp ")"
| "num"
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wprecedence input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wprecedence input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y" "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:205"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:205"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:205"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wprecedence input.y"
at_fn_check_prepare_trace "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wprecedence input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-9: warning: useless precedence and associativity for \"=\" [-Wprecedence]
input.y:4.1-5: warning: useless associativity for \"*\", use %precedence [-Wprecedence]
input.y:5.1-11: warning: useless precedence for \"(\" [-Wprecedence]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror" "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:2.1-9: warning: useless precedence and associativity for "=" [-Wprecedence]
input.y:4.1-5: warning: useless associativity for "*", use %precedence [-Wprecedence]
input.y:5.1-11: warning: useless precedence for "(" [-Wprecedence]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:205"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error" "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none" "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:205: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none" "conflicts.at:205"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:205"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_206
#AT_START_207
at_fn_group_banner 207 'conflicts.at:218' \
"Useless precedence warning" " " 10
at_xfail=no
(
printf "%s\n" "207. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B U V W X Y Z
%precedence Z
%left X
%precedence Y
%left W
%right V
%nonassoc U
%%
a: b
| a U b
| f
;
b: c
| b V c
;
c: d
| c W d
;
d: A
| d X d
| d Y A
;
f: B
| f Z B
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wprecedence -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y" "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wprecedence -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:248"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:248"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:248"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence]
7 | %nonassoc U
| ^~~~~~~~~
input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence]
6 | %right V
| ^~~~~~
input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence]
5 | %left W
| ^~~~~
input.y:2.1-11: warning: useless precedence for Z [-Wprecedence]
2 | %precedence Z
| ^~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror" "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:7.1-9: warning: useless precedence and associativity for U [-Wprecedence]
7 | %nonassoc U
| ^~~~~~~~~
input.y:6.1-6: warning: useless precedence and associativity for V [-Wprecedence]
6 | %right V
| ^~~~~~
input.y:5.1-5: warning: useless precedence and associativity for W [-Wprecedence]
5 | %left W
| ^~~~~
input.y:2.1-11: warning: useless precedence for Z [-Wprecedence]
2 | %precedence Z
| ^~~~~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:248"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error" "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:248: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:248"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wprecedence -fcaret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:248"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_207
#AT_START_208
at_fn_group_banner 208 'conflicts.at:275' \
"S/R in initial" " " 10
at_xfail=no
(
printf "%s\n" "208. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%expect 1
%%
exp: e 'e';
e: 'e' | %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:284"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:284"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:284"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:284"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:284: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:284"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:284"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:288"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:288"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:288"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother]
4 | e: 'e' | %empty;
| ^~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:4.10-15: warning: rule useless in parser due to conflicts [-Wother]
4 | e: 'e' | %empty;
| ^~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:288"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:288: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:288"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:288"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_208
#AT_START_209
at_fn_group_banner 209 'conflicts.at:301' \
"%nonassoc and eof" " " 10
at_xfail=no
(
printf "%s\n" "209. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/* The current argument. */
static const char *input;
static int
yylex (void)
{
static size_t toknum;
assert (toknum <= strlen (input));
return input[toknum++];
}
%}
%define parse.error verbose
%nonassoc '<' '>'
%%
expr: expr '<' expr
| expr '>' expr
| '0'
;
%%
int
main (int argc, const char *argv[])
{
input = argc <= 1 ? "" : argv[1];
return yyparse ();
}
_ATEOF
# Expected token list is missing.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:368" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:368"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:368"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:368"
( $at_check_trace; $PREPARSER ./input '0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:368"
( $at_check_trace; $PREPARSER ./input '0<0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '<'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:368"
( $at_check_trace; $PREPARSER ./input '0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:368"
( $at_check_trace; $PREPARSER ./input '0>0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:368"
( $at_check_trace; $PREPARSER ./input '0<0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
# We must disable default reductions in inconsistent states in order to
# have an explicit list of all expected tokens.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dlr.default-reduction=consistent -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y" "conflicts.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.default-reduction=consistent -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.default-reduction=consistent -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.default-reduction=consistent -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:372" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:372"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:372"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:372"
( $at_check_trace; $PREPARSER ./input '0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:372"
( $at_check_trace; $PREPARSER ./input '0<0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '<', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:372"
( $at_check_trace; $PREPARSER ./input '0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:372"
( $at_check_trace; $PREPARSER ./input '0>0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:372"
( $at_check_trace; $PREPARSER ./input '0<0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# lr.default-reduction=consistent happens to work for this test case.
# However, for other grammars, lookahead sets can be merged for
# different left contexts, so it is still possible to have an incorrect
# expected list. Canonical LR is almost a general solution (that is, it
# can fail only when %nonassoc is used), so make sure it gives the same
# result as above.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:381"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:381"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:381"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:381"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:381" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:381"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:381"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:381"
( $at_check_trace; $PREPARSER ./input '0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:381"
( $at_check_trace; $PREPARSER ./input '0<0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '<', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:381"
( $at_check_trace; $PREPARSER ./input '0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:381"
( $at_check_trace; $PREPARSER ./input '0>0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:381"
( $at_check_trace; $PREPARSER ./input '0<0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:381: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:381"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:381"
$at_failed && at_fn_log_failure
$at_traceon; }
# parse.lac=full is a completely general solution that does not require
# any of the above sacrifices. Of course, it does not extend the
# language-recognition power of LALR to (IE)LR, but it does ensure that
# the reported list of expected tokens matches what the given parser
# would have accepted in place of the unexpected token.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y" "conflicts.at:388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:388"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:388"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:388" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:388"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:388"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$PREPARSER ./input '0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0'" "conflicts.at:388"
( $at_check_trace; $PREPARSER ./input '0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$PREPARSER ./input '0<0<0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0<0'" "conflicts.at:388"
( $at_check_trace; $PREPARSER ./input '0<0<0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '<', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$PREPARSER ./input '0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0'" "conflicts.at:388"
( $at_check_trace; $PREPARSER ./input '0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$PREPARSER ./input '0>0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0>0>0'" "conflicts.at:388"
( $at_check_trace; $PREPARSER ./input '0>0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: \$PREPARSER ./input '0<0>0'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '0<0>0'" "conflicts.at:388"
( $at_check_trace; $PREPARSER ./input '0<0>0'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:388: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:388"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected '>', expecting end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:388"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_209
#AT_START_210
at_fn_group_banner 210 'conflicts.at:509' \
"parse.error=verbose and consistent errors: lr.type=ielr" "" 10
at_xfail=no
(
printf "%s\n" "210. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type ielr
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:509"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:509"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:509"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:509"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:509"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:509"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:509" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:509"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:509"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:509"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:509: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:509"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:509"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_210
#AT_START_211
at_fn_group_banner 211 'conflicts.at:513' \
"parse.error=verbose and consistent errors: lr.type=ielr %glr-parser" "" 10
at_xfail=no
(
printf "%s\n" "211. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%define lr.type ielr
%glr-parser
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:513"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:513"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:513"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:513"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:513"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:513"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:513" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:513"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:513"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:513"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:513: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:513"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:513"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_211
#AT_START_212
at_fn_group_banner 212 'conflicts.at:518' \
"parse.error=verbose and consistent errors: lr.type=ielr c++" "" 10
at_xfail=no
(
printf "%s\n" "212. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
static int yylex (yy::parser::value_type *lvalp);
#define USE(Var)
}
%header
%define lr.type ielr
%language "c++"
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
/*-------.
| main. |
`-------*/
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:518"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:518"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:518"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:518"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:518"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:518"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:518" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:518"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:518"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:518"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:518: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:518"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:518"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_212
#AT_START_213
at_fn_group_banner 213 'conflicts.at:523' \
"parse.error=verbose and consistent errors: lr.type=ielr java" "" 10
at_xfail=no
(
printf "%s\n" "213. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code imports {
import java.io.IOException;
}
%define lr.type ielr
%language "java"
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%code lexer {
/*--------.
| yylex. |
`--------*/
public String input = "a";
public int index = 0;
public int yylex() {
if (index < input.length())
return input.charAt(index++);
else
return 0;
}
public Object getLVal() {
return new Integer(1);
}
public void yyerror (String m)
{
System.err.println (m);
}
};
%%
/*-------.
| main. |
`-------*/
class input
{
public static void main(String[] args) throws IOException {
YYParser p = new YYParser();
boolean success = p.parse();
if (!success)
System.exit(1);
}
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:523"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "conflicts.at:523"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:523"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:523"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:523"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y"
at_fn_check_prepare_trace "conflicts.at:523"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:523" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:523"
printf "%s\n" "conflicts.at:523" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:523"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: \$SHELL ../../../javacomp.sh input.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "conflicts.at:523"
( $at_check_trace; $SHELL ../../../javacomp.sh input.java
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:523: \$SHELL ../../../javaexec.sh input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "conflicts.at:523"
( $at_check_trace; $SHELL ../../../javaexec.sh input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:523"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_213
#AT_START_214
at_fn_group_banner 214 'conflicts.at:530' \
"parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=consistent" "" 10
at_xfail=no
(
printf "%s\n" "214. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type ielr
%define lr.default-reduction consistent
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:530"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:530"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:530"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:530"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:530"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:530"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:530" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:530"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:530"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:530"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:530: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:530"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'a' or 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:530"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_214
#AT_START_215
at_fn_group_banner 215 'conflicts.at:535' \
"parse.error=verbose and consistent errors: lr.type=ielr lr.default-reduction=accepting" "" 10
at_xfail=no
(
printf "%s\n" "215. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type ielr
%define lr.default-reduction accepting
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:535"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:535"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:535"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:535"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:535"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:535"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:535" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:535"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:535"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:535"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:535: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:535"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'a' or 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:535"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_215
#AT_START_216
at_fn_group_banner 216 'conflicts.at:540' \
"parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 10
at_xfail=no
(
printf "%s\n" "216. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type canonical-lr
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:540"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:540"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:540"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:540" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:540"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:540"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:540"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:540: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:540"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'a' or 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_216
#AT_START_217
at_fn_group_banner 217 'conflicts.at:546' \
"parse.error=verbose and consistent errors: lr.type=canonical-lr parse.lac=full" "" 10
at_xfail=no
(
printf "%s\n" "217. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type canonical-lr
%define parse.lac full
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:546"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:546"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:546"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:546"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:546"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:546"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:546" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:546"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:546"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:546"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:546: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:546"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:546"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_217
#AT_START_218
at_fn_group_banner 218 'conflicts.at:551' \
"parse.error=verbose and consistent errors: lr.type=ielr parse.lac=full" "" 10
at_xfail=no
(
printf "%s\n" "218. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type ielr
%define parse.lac full
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:551"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:551"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:551"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:551"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:551"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:551"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:551" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:551"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:551"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:551"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:551: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:551"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:551"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_218
#AT_START_219
at_fn_group_banner 219 'conflicts.at:558' \
"parse.error=verbose and consistent errors: c++ lr.type=canonical-lr parse.lac=full" "" 10
at_xfail=no
(
printf "%s\n" "219. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
static int yylex (yy::parser::value_type *lvalp);
#define USE(Var)
}
%header
%language "c++"
%define lr.type canonical-lr
%define parse.lac full
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
/*-------.
| main. |
`-------*/
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:558"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:558"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:558"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:558"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:558"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:558"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:558" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:558"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:558"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:558"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:558: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:558"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:558"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_219
#AT_START_220
at_fn_group_banner 220 'conflicts.at:564' \
"parse.error=verbose and consistent errors: c++ lr.type=ielr parse.lac=full" "" 10
at_xfail=no
(
printf "%s\n" "220. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
static int yylex (yy::parser::value_type *lvalp);
#define USE(Var)
}
%header
%language "c++"
%define lr.type ielr
%define parse.lac full
%define parse.error verbose
%%
%nonassoc 'a';
start: consistent-error-on-a-a 'a' ;
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
| 'a' shift
;
default-reduction: %empty ;
shift: 'b' ;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error-on-a-a 'c' ;
%%
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "a";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
/*-------.
| main. |
`-------*/
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:564"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:564"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:564"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:564"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:564"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:564"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:564" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:564"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:564"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:564"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:564: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:564"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:564"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_220
#AT_START_221
at_fn_group_banner 221 'conflicts.at:622' \
"parse.error=verbose and consistent errors: " " " 10
at_xfail=no
(
printf "%s\n" "221. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:622"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:622"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:622"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:622"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:622"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:622"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:622" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:622"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:622"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:622"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:622: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:622"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:622"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_221
#AT_START_222
at_fn_group_banner 222 'conflicts.at:626' \
"parse.error=verbose and consistent errors: %glr-parser" "" 10
at_xfail=no
(
printf "%s\n" "222. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%glr-parser
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:626"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:626"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:626"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:626"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:626"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:626"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:626" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:626"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:626"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:626"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:626: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:626"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:626"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_222
#AT_START_223
at_fn_group_banner 223 'conflicts.at:632' \
"parse.error=verbose and consistent errors: lr.default-reduction=consistent" "" 10
at_xfail=no
(
printf "%s\n" "223. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.default-reduction consistent
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:632"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:632"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:632"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:632"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:632" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:632"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:632"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:632"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:632: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:632"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:632"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_223
#AT_START_224
at_fn_group_banner 224 'conflicts.at:638' \
"parse.error=verbose and consistent errors: lr.default-reduction=accepting" "" 10
at_xfail=no
(
printf "%s\n" "224. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.default-reduction accepting
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:638"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:638"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:638"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:638" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:638"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:638"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:638"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:638: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:638"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'a'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:638"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_224
#AT_START_225
at_fn_group_banner 225 'conflicts.at:642' \
"parse.error=verbose and consistent errors: lr.type=canonical-lr" "" 10
at_xfail=no
(
printf "%s\n" "225. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define lr.type canonical-lr
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:642"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:642"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:642"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:642"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:642" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:642"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:642"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:642"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:642: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:642"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file, expecting 'a'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:642"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_225
#AT_START_226
at_fn_group_banner 226 'conflicts.at:647' \
"parse.error=verbose and consistent errors: parse.lac=full" "" 10
at_xfail=no
(
printf "%s\n" "226. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define parse.lac full
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:647"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:647"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:647"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:647"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:647"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:647"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:647" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:647"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:647"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:647"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:647: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:647"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:647"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_226
#AT_START_227
at_fn_group_banner 227 'conflicts.at:651' \
"parse.error=verbose and consistent errors: parse.lac=full lr.default-reduction=accepting" "" 10
at_xfail=no
(
printf "%s\n" "227. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
#define USE(Var)
}
%define api.pure
%code {
#if defined __GNUC__ && 8 <= __GNUC__
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
}
%define parse.lac full
%define lr.default-reduction accepting
%define parse.error verbose
%%
%nonassoc 'a';
// If $$ = 0 here, then we know that the 'a' destructor is being invoked
// incorrectly for the 'b' set in the semantic action below. All 'a'
// tokens are returned by yylex, which sets $$ = 1.
%destructor {
if (!$$)
fprintf (stderr, "Wrong destructor.\n");
} 'a';
// Rather than depend on an inconsistent state to induce reading a
// lookahead as in the previous grammar, just assign the lookahead in a
// semantic action. That lookahead isn't needed before either error
// action is encountered. In a previous version of Bison, this was a
// problem as it meant yychar was not translated into yytoken before
// either error action. The second error action thus invoked a
// destructor that it selected according to the incorrect yytoken. The
// first error action would have reported an incorrect unexpected token
// except that, due to the bug described in the previous grammar, the
// unexpected token was not reported at all.
start: error-reduce consistent-error 'a' { USE ($3); } ;
error-reduce:
'a' 'a' consistent-reduction consistent-error 'a'
{ USE (($1, $2, $5)); }
| 'a' error
{ USE ($1); }
;
consistent-reduction: %empty
{
assert (yychar == YYEMPTY);
yylval = 0;
yychar = 'b';
} ;
consistent-error:
'a' { USE ($1); }
| %empty %prec 'a'
;
// Provide another context in which all rules are useful so that this
// test case looks a little more realistic.
start: 'b' consistent-error 'b' ;
%%
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = 1;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
/*-------.
| main. |
`-------*/
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:651"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:651"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:651"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:651"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:651"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:651"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "conflicts.at:651" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:651"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:651"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:651"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:651: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:651"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected end of file
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:651"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_227
#AT_START_228
at_fn_group_banner 228 'conflicts.at:676' \
"LAC: %nonassoc requires splitting canonical LR states" "" 10
at_xfail=no
(
printf "%s\n" "228. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%define parse.error verbose
%nonassoc 'a'
%%
start:
'a' problem 'a' // First context.
| 'b' problem 'b' // Second context.
| 'c' reduce-nonassoc // Just makes reduce-nonassoc useful.
;
problem:
look reduce-nonassoc
| look 'a'
| look 'b'
;
// For the state reached after shifting the 'a' in these productions,
// lookahead sets are the same in both the first and second contexts.
// Thus, canonical LR reuses the same state for both contexts. However,
// the lookahead 'a' for the reduction "look: 'a'" later becomes an
// error action only in the first context. In order to immediately
// detect the syntax error on 'a' here for only the first context, this
// canonical LR state would have to be split into two states, and the
// 'a' lookahead would have to be removed from only one of the states.
look:
'a' // Reduction lookahead set is always ['a', 'b'].
| 'a' 'b'
| 'a' 'c' // 'c' is forgotten as an expected token.
;
reduce-nonassoc: %prec 'a';
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "aaa";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Show canonical LR's failure.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y" "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:726"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:726"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:726"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror" "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:726"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error" "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:726: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:726"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:726"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:731" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:731"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:731: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:731"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:731"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:732: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:732"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:732"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:732: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:732"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'a', expecting 'b'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:732"
$at_failed && at_fn_log_failure
$at_traceon; }
# It's corrected by LAC.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:737"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:737"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:737"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y -Werror"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:737"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y --warnings=error"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:737: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \\
-o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:737"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=canonical-lr -Dparse.lac=full \
-o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:737"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:742" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:742"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:742: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:742"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:742"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:743: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:743"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:743"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:743: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:743"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'a', expecting 'b' or 'c'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:743"
$at_failed && at_fn_log_failure
$at_traceon; }
# IELR is sufficient when LAC is used.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y" "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:748"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:748"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:748"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror" "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:748"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error" "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:748: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:748"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Dlr.type=ielr -Dparse.lac=full -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:748"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:753" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:753"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:753: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:753"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:753"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:754: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:754"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:754: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:754"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error, unexpected 'a', expecting 'b' or 'c'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:754"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_228
#AT_START_229
at_fn_group_banner 229 'conflicts.at:764' \
"Unresolved SR Conflicts" " " 10
at_xfail=no
(
printf "%s\n" "229. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%%
exp: exp OP exp | NUM;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:774"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:774"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:774"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:774"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:774: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:774"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:774"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# Check the contents of the report.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:780: cat input.output"
at_fn_check_prepare_trace "conflicts.at:780"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 5 conflicts: 1 shift/reduce
Grammar
0 \$accept: exp \$end
1 exp: exp OP exp
2 | NUM
Terminals, with rules where they appear
\$end (0) 0
error (256)
NUM (258) 2
OP (259) 1
Nonterminals, with rules where they appear
\$accept (5)
on left: 0
exp (6)
on left: 1 2
on right: 0 1
State 0
0 \$accept: . exp \$end
1 exp: . exp OP exp
2 | . NUM
NUM shift, and go to state 1
exp go to state 2
State 1
2 exp: NUM .
\$default reduce using rule 2 (exp)
State 2
0 \$accept: exp . \$end
1 exp: exp . OP exp
\$end shift, and go to state 3
OP shift, and go to state 4
State 3
0 \$accept: exp \$end .
\$default accept
State 4
1 exp: . exp OP exp
1 | exp OP . exp
2 | . NUM
NUM shift, and go to state 1
exp go to state 5
State 5
1 exp: exp . OP exp
1 | exp OP exp . [\$end, OP]
OP shift, and go to state 4
OP [reduce using rule 1 (exp)]
\$default reduce using rule 1 (exp)
shift/reduce conflict on token OP:
1 exp: exp OP exp .
1 exp: exp . OP exp
Example: exp OP exp . OP exp
Shift derivation
exp
\`-> 1: exp OP exp
\`-> 1: exp . OP exp
Reduce derivation
exp
\`-> 1: exp OP exp
\`-> 1: exp OP exp .
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:780"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_229
#AT_START_230
at_fn_group_banner 230 'conflicts.at:887' \
"Resolved SR Conflicts" " " 10
at_xfail=no
(
printf "%s\n" "230. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%left OP
%%
exp: exp OP exp | NUM;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:898"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:898"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:898"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:898"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:898"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:898: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:898"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:898"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the contents of the report.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:901: cat input.output"
at_fn_check_prepare_trace "conflicts.at:901"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Grammar
0 \$accept: exp \$end
1 exp: exp OP exp
2 | NUM
Terminals, with rules where they appear
\$end (0) 0
error (256)
NUM (258) 2
OP (259) 1
Nonterminals, with rules where they appear
\$accept (5)
on left: 0
exp (6)
on left: 1 2
on right: 0 1
State 0
0 \$accept: . exp \$end
1 exp: . exp OP exp
2 | . NUM
NUM shift, and go to state 1
exp go to state 2
State 1
2 exp: NUM .
\$default reduce using rule 2 (exp)
State 2
0 \$accept: exp . \$end
1 exp: exp . OP exp
\$end shift, and go to state 3
OP shift, and go to state 4
State 3
0 \$accept: exp \$end .
\$default accept
State 4
1 exp: . exp OP exp
1 | exp OP . exp
2 | . NUM
NUM shift, and go to state 1
exp go to state 5
State 5
1 exp: exp . OP exp
1 | exp OP exp . [\$end, OP]
\$default reduce using rule 1 (exp)
Conflict between rule 1 and token OP resolved as reduce (%left OP).
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:901"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_230
#AT_START_231
at_fn_group_banner 231 'conflicts.at:989' \
"%precedence suffices" " " 10
at_xfail=no
(
printf "%s\n" "231. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%precedence "then"
%precedence "else"
%%
stmt:
"if" cond "then" stmt
| "if" cond "then" stmt "else" stmt
| "stmt"
;
cond:
"exp"
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1006"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1006"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1006"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1006"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1006"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1006: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1006"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1006"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_231
#AT_START_232
at_fn_group_banner 232 'conflicts.at:1015' \
"%precedence does not suffice" " " 10
at_xfail=no
(
printf "%s\n" "232. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%precedence "then"
%precedence "else"
%%
stmt:
"if" cond "then" stmt
| "if" cond "then" stmt "else" stmt
| "stmt"
;
cond:
"exp"
| cond "then" cond
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1033"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1033"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1033"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:12.3-18: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:12.3-18: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1033"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1033: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1033"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1033"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_232
#AT_START_233
at_fn_group_banner 233 'conflicts.at:1096' \
"Syntax error in consistent error state: yacc.c" " " 10
at_xfail=no
(
printf "%s\n" "233. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%skeleton "yacc.c"
%%
%nonassoc 'a';
start: 'a' consistent-error-on-a-a 'a';
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
;
default-reduction: %empty;
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1096"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:1096"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1096"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_233
#AT_START_234
at_fn_group_banner 234 'conflicts.at:1096' \
"Syntax error in consistent error state: glr.c" " " 10
at_xfail=no
(
printf "%s\n" "234. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%skeleton "glr.c"
%%
%nonassoc 'a';
start: 'a' consistent-error-on-a-a 'a';
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
;
default-reduction: %empty;
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1096"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "conflicts.at:1096"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1096"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_234
#AT_START_235
at_fn_group_banner 235 'conflicts.at:1096' \
"Syntax error in consistent error state: lalr1.cc" "" 10
at_xfail=no
(
printf "%s\n" "235. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%skeleton "lalr1.cc"
%%
%nonassoc 'a';
start: 'a' consistent-error-on-a-a 'a';
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
;
default-reduction: %empty;
%code {
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1096"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:1096"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1096"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_235
#AT_START_236
at_fn_group_banner 236 'conflicts.at:1096' \
"Syntax error in consistent error state: glr.cc" " " 10
at_xfail=no
(
printf "%s\n" "236. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%skeleton "glr.cc"
%%
%nonassoc 'a';
start: 'a' consistent-error-on-a-a 'a';
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
;
default-reduction: %empty;
%code {
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1096"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:1096"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1096"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_236
#AT_START_237
at_fn_group_banner 237 'conflicts.at:1096' \
"Syntax error in consistent error state: glr2.cc" "" 10
at_xfail=no
(
printf "%s\n" "237. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%skeleton "glr2.cc"
%%
%nonassoc 'a';
start: 'a' consistent-error-on-a-a 'a';
consistent-error-on-a-a:
'a' default-reduction
| 'a' default-reduction 'a'
;
default-reduction: %empty;
%code {
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "aa";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1096"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:17.5-25: warning: rule useless in parser due to conflicts [-Wother]
input.y:18.5-29: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1096"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none" "conflicts.at:1096"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.cc input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
printf "%s\n" "conflicts.at:1096" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/conflicts.at:1096"
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "conflicts.at:1096"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "conflicts.at:1096"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1096: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "conflicts.at:1096"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1096"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_237
#AT_START_238
at_fn_group_banner 238 'conflicts.at:1127' \
"Defaulted Conflicted Reduction" " " 10
at_xfail=no
(
printf "%s\n" "238. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: num | id;
num: '0';
id : '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y" "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1138"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1138"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1138"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:4.6-8: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror" "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:4.6-8: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1138"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error" "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1138: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:1138"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c --report=all input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1138"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# Check the contents of the report.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1145: cat input.output"
at_fn_check_prepare_trace "conflicts.at:1145"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Rules useless in parser due to conflicts
4 id: '0'
State 1 conflicts: 1 reduce/reduce
Grammar
0 \$accept: exp \$end
1 exp: num
2 | id
3 num: '0'
4 id: '0'
Terminals, with rules where they appear
\$end (0) 0
'0' (48) 3 4
error (256)
Nonterminals, with rules where they appear
\$accept (4)
on left: 0
exp (5)
on left: 1 2
on right: 0
num (6)
on left: 3
on right: 1
id (7)
on left: 4
on right: 2
State 0
0 \$accept: . exp \$end
1 exp: . num
2 | . id
3 num: . '0'
4 id: . '0'
'0' shift, and go to state 1
exp go to state 2
num go to state 3
id go to state 4
State 1
3 num: '0' . [\$end]
4 id: '0' . [\$end]
\$end reduce using rule 3 (num)
\$end [reduce using rule 4 (id)]
\$default reduce using rule 3 (num)
reduce/reduce conflict on token \$end:
3 num: '0' .
4 id: '0' .
Example: '0' .
First reduce derivation
exp
\`-> 1: num
\`-> 3: '0' .
Second reduce derivation
exp
\`-> 2: id
\`-> 4: '0' .
State 2
0 \$accept: exp . \$end
\$end shift, and go to state 5
State 3
1 exp: num .
\$default reduce using rule 1 (exp)
State 4
2 exp: id .
\$default reduce using rule 2 (exp)
State 5
0 \$accept: exp \$end .
\$default accept
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1145"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_238
#AT_START_239
at_fn_group_banner 239 'conflicts.at:1264' \
"%expect not enough" " " 10
at_xfail=no
(
printf "%s\n" "239. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 0
%%
exp: exp OP exp | NUM;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1273: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1273"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: error: shift/reduce conflicts: 1 found, 0 expected
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1273"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_239
#AT_START_240
at_fn_group_banner 240 'conflicts.at:1284' \
"%expect right" " " 10
at_xfail=no
(
printf "%s\n" "240. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 1
%%
exp: exp OP exp | NUM;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1293"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1293"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1293"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1293"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1293"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1293: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1293"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1293"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_240
#AT_START_241
at_fn_group_banner 241 'conflicts.at:1301' \
"%expect too much" " " 10
at_xfail=no
(
printf "%s\n" "241. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 2
%%
exp: exp OP exp | NUM;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1310: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1310"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: error: shift/reduce conflicts: 1 found, 2 expected
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1310"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_241
#AT_START_242
at_fn_group_banner 242 'conflicts.at:1321' \
"%expect with reduce conflicts" " " 10
at_xfail=no
(
printf "%s\n" "242. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%expect 0
%%
program: a 'a' | a a;
a: 'a';
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: error: reduce/reduce conflicts: 1 found, 0 expected
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1330"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_242
#AT_START_243
at_fn_group_banner 243 'conflicts.at:1341' \
"%expect in grammar rule not enough" " " 10
at_xfail=no
(
printf "%s\n" "243. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 1
%%
exp: exp OP exp %expect 0 | NUM;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1350: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1350"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.6-25: error: shift/reduce conflicts for rule 1: 1 found, 0 expected
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_243
#AT_START_244
at_fn_group_banner 244 'conflicts.at:1360' \
"%expect in grammar rule right" " " 10
at_xfail=no
(
printf "%s\n" "244. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 1
%%
exp: exp OP exp %expect 1 | NUM;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1369"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_244
#AT_START_245
at_fn_group_banner 245 'conflicts.at:1377' \
"%expect in grammar rules" " " 10
at_xfail=no
(
printf "%s\n" "245. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%expect 4
%%
exp:
"number"
| exp "+" exp %expect 2
| exp "*" exp %expect 2
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c -rall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c -rall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y" "conflicts.at:1388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -rall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1388"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1388"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1388"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1388: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -rall input.y"
at_fn_check_prepare_trace "conflicts.at:1388"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -rall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1388"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_245
#AT_START_246
at_fn_group_banner 246 'conflicts.at:1396' \
"%expect in grammar rule too much" " " 10
at_xfail=no
(
printf "%s\n" "246. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token NUM OP
%expect 1
%%
exp: exp OP exp | NUM %expect 1;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1405: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y" "conflicts.at:1405"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:4.19-31: error: shift/reduce conflicts for rule 2: 0 found, 1 expected
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_246
#AT_START_247
at_fn_group_banner 247 'conflicts.at:1415' \
"%expect-rr in grammar rule" " " 10
at_xfail=no
(
printf "%s\n" "247. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%glr-parser
%expect-rr 3
%%
exp
: a '1'
| a '2'
| a '3'
| b '1'
| b '2'
| b '3'
a:
b: %expect-rr 3
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1432"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1432"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1432"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_247
#AT_START_248
at_fn_group_banner 248 'conflicts.at:1440' \
"%expect-rr too much in grammar rule" " " 10
at_xfail=no
(
printf "%s\n" "248. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%glr-parser
%expect-rr 3
%%
exp
: a '1'
| a '2'
| a '3'
| b '1'
| b '2'
| b '3'
a:
b: %expect-rr 4
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1457: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "conflicts.at:1457"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 4 expected
12 | b: %expect-rr 4
| ^~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1457"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_248
#AT_START_249
at_fn_group_banner 249 'conflicts.at:1469' \
"%expect-rr not enough in grammar rule" " " 10
at_xfail=no
(
printf "%s\n" "249. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%glr-parser
%expect-rr 3
%%
exp
: a '1'
| a '2'
| a '3'
| b '1'
| b '2'
| b '3'
a:
b: %expect-rr 2
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1486: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y" "conflicts.at:1486"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:12.4-15: error: reduce/reduce conflicts for rule 8: 3 found, 2 expected
12 | b: %expect-rr 2
| ^~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1486"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_249
#AT_START_250
at_fn_group_banner 250 'conflicts.at:1498' \
"%prec with user string" " " 10
at_xfail=no
(
printf "%s\n" "250. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp:
"foo" %prec "foo"
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1507"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1507"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1507"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1507"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1507"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1507: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1507"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1507"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_250
#AT_START_251
at_fn_group_banner 251 'conflicts.at:1515' \
"%no-default-prec without %prec" " " 10
at_xfail=no
(
printf "%s\n" "251. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%left '+'
%left '*'
%%
%no-default-prec;
e: e '+' e
| e '*' e
| '0'
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y" "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1531"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1531"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1531"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:1.1-5: warning: useless precedence and associativity for '+' [-Wprecedence]
input.y:2.1-5: warning: useless precedence and associativity for '*' [-Wprecedence]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror" "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 4 shift/reduce conflicts [-Wconflicts-sr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:1.1-5: warning: useless precedence and associativity for '+' [-Wprecedence]
input.y:2.1-5: warning: useless precedence and associativity for '*' [-Wprecedence]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1531"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error" "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1531: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1531"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wall -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1531"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_251
#AT_START_252
at_fn_group_banner 252 'conflicts.at:1544' \
"%no-default-prec with %prec" " " 10
at_xfail=no
(
printf "%s\n" "252. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%left '+'
%left '*'
%%
%no-default-prec;
e: e '+' e %prec '+'
| e '*' e %prec '*'
| '0'
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1560"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1560"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1560"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1560"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1560"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1560: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1560"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1560"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_252
#AT_START_253
at_fn_group_banner 253 'conflicts.at:1568' \
"%default-prec" " " 10
at_xfail=no
(
printf "%s\n" "253. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%left '+'
%left '*'
%%
%default-prec;
e: e '+' e
| e '*' e
| '0'
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1584"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "conflicts.at:1584"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1584"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1584"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1584"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1584: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1584"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1584"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_253
#AT_START_254
at_fn_group_banner 254 'conflicts.at:1592' \
"Unreachable States After Conflict Resolution" " " 10
at_xfail=no
(
printf "%s\n" "254. $at_setup_line: testing $at_desc ..."
$at_traceon
# If conflict resolution makes states unreachable, remove those states, report
# rules that are then unused, and don't report conflicts in those states. Test
# what happens when a nonterminal becomes useless as a result of state removal
# since that causes lalr.o's goto map to be rewritten.
cat >input.y <<'_ATEOF'
%output "input.c"
%left 'a'
%%
start: resolved_conflict 'a' reported_conflicts 'a' ;
/* S/R conflict resolved as reduce, so the state with item
* (resolved_conflict: 'a' . unreachable1) and all it transition successors are
* unreachable, and the associated production is useless. */
resolved_conflict:
'a' unreachable1
| %prec 'a'
;
/* S/R conflict that need not be reported since it is unreachable because of
* the previous conflict resolution. Nonterminal unreachable1 and all its
* productions are useless. */
unreachable1:
'a' unreachable2
|
;
/* Likewise for a R/R conflict and nonterminal unreachable2. */
unreachable2: | ;
/* Make sure remaining S/R and R/R conflicts are still reported correctly even
* when their states are renumbered due to state removal. */
reported_conflicts:
'a'
| 'a'
|
;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --report=all input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y" "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1638"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1638"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1638"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all input.y"
at_fn_check_prepare_trace "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:12.5-20: warning: rule useless in parser due to conflicts [-Wother]
input.y:20.5-20: warning: rule useless in parser due to conflicts [-Wother]
input.y:21.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:25.14: warning: rule useless in parser due to conflicts [-Wother]
input.y:25.16: warning: rule useless in parser due to conflicts [-Wother]
input.y:31.5-7: warning: rule useless in parser due to conflicts [-Wother]
input.y:32.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror" "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:12.5-20: warning: rule useless in parser due to conflicts [-Wother]
input.y:20.5-20: warning: rule useless in parser due to conflicts [-Wother]
input.y:21.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:25.14: warning: rule useless in parser due to conflicts [-Wother]
input.y:25.16: warning: rule useless in parser due to conflicts [-Wother]
input.y:31.5-7: warning: rule useless in parser due to conflicts [-Wother]
input.y:32.4: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1638"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error" "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none" "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1638: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none" "conflicts.at:1638"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1638"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1651: cat input.output"
at_fn_check_prepare_trace "conflicts.at:1651"
( $at_check_trace; cat input.output
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Rules useless in parser due to conflicts
2 resolved_conflict: 'a' unreachable1
4 unreachable1: 'a' unreachable2
5 | %empty
6 unreachable2: %empty
7 | %empty
9 reported_conflicts: 'a'
10 | %empty
State 4 conflicts: 1 shift/reduce
State 5 conflicts: 1 reduce/reduce
Grammar
0 \$accept: start \$end
1 start: resolved_conflict 'a' reported_conflicts 'a'
2 resolved_conflict: 'a' unreachable1
3 | %empty
4 unreachable1: 'a' unreachable2
5 | %empty
6 unreachable2: %empty
7 | %empty
8 reported_conflicts: 'a'
9 | 'a'
10 | %empty
Terminals, with rules where they appear
\$end (0) 0
'a' (97) 1 2 4 8 9
error (256)
Nonterminals, with rules where they appear
\$accept (4)
on left: 0
start (5)
on left: 1
on right: 0
resolved_conflict (6)
on left: 2 3
on right: 1
unreachable1 (7)
on left: 4 5
on right: 2
unreachable2 (8)
on left: 6 7
on right: 4
reported_conflicts (9)
on left: 8 9 10
on right: 1
State 0
0 \$accept: . start \$end
1 start: . resolved_conflict 'a' reported_conflicts 'a'
2 resolved_conflict: . 'a' unreachable1
3 | %empty . ['a']
\$default reduce using rule 3 (resolved_conflict)
start go to state 1
resolved_conflict go to state 2
Conflict between rule 3 and token 'a' resolved as reduce (%left 'a').
State 1
0 \$accept: start . \$end
\$end shift, and go to state 3
State 2
1 start: resolved_conflict . 'a' reported_conflicts 'a'
'a' shift, and go to state 4
State 3
0 \$accept: start \$end .
\$default accept
State 4
1 start: resolved_conflict 'a' . reported_conflicts 'a'
8 reported_conflicts: . 'a'
9 | . 'a'
10 | %empty . ['a']
'a' shift, and go to state 5
'a' [reduce using rule 10 (reported_conflicts)]
reported_conflicts go to state 6
shift/reduce conflict on token 'a':
10 reported_conflicts: %empty .
8 reported_conflicts: . 'a'
First example: resolved_conflict . 'a' 'a'
Shift derivation
start
\`-> 1: resolved_conflict reported_conflicts 'a'
\`-> 8: . 'a'
Second example: resolved_conflict . 'a'
Reduce derivation
start
\`-> 1: resolved_conflict reported_conflicts 'a'
\`-> 10: %empty .
shift/reduce conflict on token 'a':
10 reported_conflicts: %empty .
9 reported_conflicts: . 'a'
First example: resolved_conflict . 'a' 'a'
Shift derivation
start
\`-> 1: resolved_conflict reported_conflicts 'a'
\`-> 9: . 'a'
Second example: resolved_conflict . 'a'
Reduce derivation
start
\`-> 1: resolved_conflict reported_conflicts 'a'
\`-> 10: %empty .
State 5
8 reported_conflicts: 'a' . ['a']
9 | 'a' . ['a']
'a' reduce using rule 8 (reported_conflicts)
'a' [reduce using rule 9 (reported_conflicts)]
\$default reduce using rule 8 (reported_conflicts)
reduce/reduce conflict on token 'a':
8 reported_conflicts: 'a' .
9 reported_conflicts: 'a' .
Example: 'a' .
First reduce derivation
reported_conflicts
\`-> 8: 'a' .
Second reduce derivation
reported_conflicts
\`-> 9: 'a' .
State 6
1 start: resolved_conflict 'a' reported_conflicts . 'a'
'a' shift, and go to state 7
State 7
1 start: resolved_conflict 'a' reported_conflicts 'a' .
\$default reduce using rule 1 (start)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1651"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input-keep.y <<'_ATEOF'
%define lr.keep-unreachable-state
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1836: cat input.y >> input-keep.y"
at_fn_check_prepare_trace "conflicts.at:1836"
( $at_check_trace; cat input.y >> input-keep.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1836"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv input-keep.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv input-keep.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y" "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml input-keep.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1838"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1838"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1838"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input-keep.y"
at_fn_check_prepare_trace "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret input-keep.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input-keep.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input-keep.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
input-keep.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input-keep.y:22.4: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:26.16: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:32.5-7: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:33.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror" "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input-keep.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input-keep.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
input-keep.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input-keep.y:22.4: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:26.16: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:32.5-7: warning: rule useless in parser due to conflicts [-Wother]
input-keep.y:33.4: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1838"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error" "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none" "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1838: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none" "conflicts.at:1838"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input-keep.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1838"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_254
#AT_START_255
at_fn_group_banner 255 'conflicts.at:1855' \
"Solved conflicts report for multiple reductions in a state" "" 10
at_xfail=no
(
printf "%s\n" "255. $at_setup_line: testing $at_desc ..."
$at_traceon
# Used to lose earlier solved conflict messages even within a single S/R/R.
cat >input.y <<'_ATEOF'
%left 'a'
%right 'b'
%right 'c'
%right 'd'
%%
start:
'a'
| empty_a 'a'
| 'b'
| empty_b 'b'
| 'c'
| empty_c1 'c'
| empty_c2 'c'
| empty_c3 'c'
;
empty_a: %empty %prec 'a' ;
empty_b: %empty %prec 'b' ;
empty_c1: %empty %prec 'c' ;
empty_c2: %empty %prec 'c' ;
empty_c3: %empty %prec 'd' ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1881"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y" "conflicts.at:1881"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1881"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1881"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1881"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1881: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1881"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1881"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1882: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:1882"
( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . 'a'
2 | . empty_a 'a'
3 | . 'b'
4 | . empty_b 'b'
5 | . 'c'
6 | . empty_c1 'c'
7 | . empty_c2 'c'
8 | . empty_c3 'c'
9 empty_a: %empty . ['a']
10 empty_b: %empty . []
11 empty_c1: %empty . []
12 empty_c2: %empty . []
13 empty_c3: %empty . ['c']
'b' shift, and go to state 1
'c' reduce using rule 13 (empty_c3)
\$default reduce using rule 9 (empty_a)
start go to state 2
empty_a go to state 3
empty_b go to state 4
empty_c1 go to state 5
empty_c2 go to state 6
empty_c3 go to state 7
Conflict between rule 9 and token 'a' resolved as reduce (%left 'a').
Conflict between rule 10 and token 'b' resolved as shift (%right 'b').
Conflict between rule 11 and token 'c' resolved as shift (%right 'c').
Conflict between rule 12 and token 'c' resolved as shift (%right 'c').
Conflict between rule 13 and token 'c' resolved as reduce ('c' < 'd').
State 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1882"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_255
#AT_START_256
at_fn_group_banner 256 'conflicts.at:1935' \
"%nonassoc error actions for multiple reductions in a state" "" 10
at_xfail=no
(
printf "%s\n" "256. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%nonassoc 'a' 'b' 'c'
%%
start:
'a'
| empty_a 'a'
| 'b'
| empty_b 'b'
| 'c'
| empty_c1 'c'
| empty_c2 'c'
| empty_c3 'c'
;
empty_a: %prec 'a' ;
empty_b: %prec 'b' ;
empty_c1: %prec 'c' ;
empty_c2: %prec 'c' ;
empty_c3: %prec 'c' ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --trace=cex -fcaret --report=all -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --trace=cex -fcaret --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=cex -fcaret --report=all -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=cex -fcaret --report=all -o input.c input.y" "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --trace=cex -fcaret --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1959"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:1959"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:1959"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y"
at_fn_check_prepare_trace "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "bison (GNU Bison) 3.8.2
init: 0.000000
# state items: 26
State 0:
0 \$accept: . start \$end
-> 0 \$accept: start . \$end
=> 2 start: . empty_a 'a'
=> 4 start: . empty_b 'b'
=> 6 start: . empty_c1 'c'
=> 7 start: . empty_c2 'c'
=> 8 start: . empty_c3 'c'
1 start: . 'a' DISABLED
2 start: . empty_a 'a'
-> 2 start: empty_a . 'a'
=> 9 empty_a: %empty .
<- 0 \$accept: . start \$end
3 start: . 'b' DISABLED
4 start: . empty_b 'b'
-> 4 start: empty_b . 'b'
=> 10 empty_b: %empty .
<- 0 \$accept: . start \$end
5 start: . 'c' DISABLED
6 start: . empty_c1 'c'
-> 6 start: empty_c1 . 'c'
=> 11 empty_c1: %empty .
<- 0 \$accept: . start \$end
7 start: . empty_c2 'c'
-> 7 start: empty_c2 . 'c'
=> 12 empty_c2: %empty .
<- 0 \$accept: . start \$end
8 start: . empty_c3 'c'
-> 8 start: empty_c3 . 'c'
=> 13 empty_c3: %empty .
<- 0 \$accept: . start \$end
9 empty_a: %empty .
<- 2 start: . empty_a 'a'
10 empty_b: %empty .
<- 4 start: . empty_b 'b'
11 empty_c1: %empty .
<- 6 start: . empty_c1 'c'
12 empty_c2: %empty .
<- 7 start: . empty_c2 'c'
13 empty_c3: %empty .
<- 8 start: . empty_c3 'c'
State 1:
0 \$accept: start . \$end
-> 0 \$accept: start \$end .
<- 0 \$accept: . start \$end
State 2:
2 start: empty_a . 'a'
-> 2 start: empty_a 'a' .
<- 2 start: . empty_a 'a'
State 3:
4 start: empty_b . 'b'
-> 4 start: empty_b 'b' .
<- 4 start: . empty_b 'b'
State 4:
6 start: empty_c1 . 'c'
-> 6 start: empty_c1 'c' .
<- 6 start: . empty_c1 'c'
State 5:
7 start: empty_c2 . 'c'
-> 7 start: empty_c2 'c' .
<- 7 start: . empty_c2 'c'
State 6:
8 start: empty_c3 . 'c'
-> 8 start: empty_c3 'c' .
<- 8 start: . empty_c3 'c'
State 7:
0 \$accept: start \$end .
<- 0 \$accept: start . \$end
State 8:
2 start: empty_a 'a' .
<- 2 start: empty_a . 'a'
State 9:
4 start: empty_b 'b' .
<- 4 start: empty_b . 'b'
State 10:
6 start: empty_c1 'c' .
<- 6 start: empty_c1 . 'c'
State 11:
7 start: empty_c2 'c' .
<- 7 start: empty_c2 . 'c'
State 12:
8 start: empty_c3 'c' .
<- 8 start: empty_c3 . 'c'
FIRSTS
\$accept firsts
'a'
'b'
'c'
start firsts
'a'
'b'
'c'
empty_a firsts
empty_b firsts
empty_c1 firsts
empty_c2 firsts
empty_c3 firsts
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:4.5-7: warning: rule useless in parser due to conflicts [-Wother]
4 | 'a'
| ^~~
input.y:6.5-7: warning: rule useless in parser due to conflicts [-Wother]
6 | | 'b'
| ^~~
input.y:8.5-7: warning: rule useless in parser due to conflicts [-Wother]
8 | | 'c'
| ^~~
input.y:13.10-18: warning: rule useless in parser due to conflicts [-Wother]
13 | empty_a: %prec 'a' ;
| ^~~~~~~~~
input.y:14.10-18: warning: rule useless in parser due to conflicts [-Wother]
14 | empty_b: %prec 'b' ;
| ^~~~~~~~~
input.y:15.11-19: warning: rule useless in parser due to conflicts [-Wother]
15 | empty_c1: %prec 'c' ;
| ^~~~~~~~~
input.y:16.11-19: warning: rule useless in parser due to conflicts [-Wother]
16 | empty_c2: %prec 'c' ;
| ^~~~~~~~~
input.y:17.11-19: warning: rule useless in parser due to conflicts [-Wother]
17 | empty_c3: %prec 'c' ;
| ^~~~~~~~~
REDUCE ITEM PATH:
0 \$accept: . start \$end
7 start: . empty_c2 'c'
12 empty_c2: %empty .
CONFLICT 1 (size 1 depth 0 rc 2)
12 empty_c2: %empty .
12 empty_c2: %empty .
.
CONFLICT 2 (size 1 depth 0 rc 2)
13 empty_c3: %empty .
13 empty_c3: %empty .
.
CONFLICT 1 (size 2 depth -1 rc 4)
7 start: . empty_c2 'c'
7 start: empty_c2 . 'c'
empty_c2
\`-> 12: %empty .
CONFLICT 2 (size 1 depth 0 rc 3)
13 empty_c3: %empty .
13 empty_c3: %empty .
.
CONFLICT 1 (size 1 depth 0 rc 3)
12 empty_c2: %empty .
12 empty_c2: %empty .
.
CONFLICT 2 (size 2 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 . 'c'
empty_c3
\`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 3)
7 start: . empty_c2 'c'
7 start: empty_c2 . 'c'
empty_c2
\`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 . 'c'
empty_c3
\`-> 13: %empty .
CONFLICT 1 (size 3 depth -1 rc 2)
7 start: . empty_c2 'c'
7 start: empty_c2 'c' .
empty_c2
\`-> 12: %empty .
CONFLICT 2 (size 3 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 'c' .
empty_c3
\`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 4)
0 \$accept: . start \$end
0 \$accept: start . \$end
start
\`-> 7: empty_c2 'c'
\`-> 12: %empty .
CONFLICT 2 (size 3 depth -1 rc 3)
8 start: . empty_c3 'c'
8 start: empty_c3 'c' .
empty_c3
\`-> 13: %empty .
CONFLICT 1 (size 3 depth -1 rc 3)
7 start: . empty_c2 'c'
7 start: empty_c2 'c' .
empty_c2
\`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
0 \$accept: . start \$end
0 \$accept: start . \$end
start
\`-> 8: empty_c3 'c'
\`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 3)
0 \$accept: . start \$end
0 \$accept: start . \$end
start
\`-> 7: empty_c2 'c'
\`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
0 \$accept: . start \$end
0 \$accept: start . \$end
start
\`-> 8: empty_c3 'c'
\`-> 13: %empty .
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Werror" "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
bison (GNU Bison) 3.8.2
init: 0.000000
# state items: 26
State 0:
0 $accept: . start $end
-> 0 $accept: start . $end
=> 2 start: . empty_a 'a'
=> 4 start: . empty_b 'b'
=> 6 start: . empty_c1 'c'
=> 7 start: . empty_c2 'c'
=> 8 start: . empty_c3 'c'
1 start: . 'a' DISABLED
2 start: . empty_a 'a'
-> 2 start: empty_a . 'a'
=> 9 empty_a: %empty .
<- 0 $accept: . start $end
3 start: . 'b' DISABLED
4 start: . empty_b 'b'
-> 4 start: empty_b . 'b'
=> 10 empty_b: %empty .
<- 0 $accept: . start $end
5 start: . 'c' DISABLED
6 start: . empty_c1 'c'
-> 6 start: empty_c1 . 'c'
=> 11 empty_c1: %empty .
<- 0 $accept: . start $end
7 start: . empty_c2 'c'
-> 7 start: empty_c2 . 'c'
=> 12 empty_c2: %empty .
<- 0 $accept: . start $end
8 start: . empty_c3 'c'
-> 8 start: empty_c3 . 'c'
=> 13 empty_c3: %empty .
<- 0 $accept: . start $end
9 empty_a: %empty .
<- 2 start: . empty_a 'a'
10 empty_b: %empty .
<- 4 start: . empty_b 'b'
11 empty_c1: %empty .
<- 6 start: . empty_c1 'c'
12 empty_c2: %empty .
<- 7 start: . empty_c2 'c'
13 empty_c3: %empty .
<- 8 start: . empty_c3 'c'
State 1:
0 $accept: start . $end
-> 0 $accept: start $end .
<- 0 $accept: . start $end
State 2:
2 start: empty_a . 'a'
-> 2 start: empty_a 'a' .
<- 2 start: . empty_a 'a'
State 3:
4 start: empty_b . 'b'
-> 4 start: empty_b 'b' .
<- 4 start: . empty_b 'b'
State 4:
6 start: empty_c1 . 'c'
-> 6 start: empty_c1 'c' .
<- 6 start: . empty_c1 'c'
State 5:
7 start: empty_c2 . 'c'
-> 7 start: empty_c2 'c' .
<- 7 start: . empty_c2 'c'
State 6:
8 start: empty_c3 . 'c'
-> 8 start: empty_c3 'c' .
<- 8 start: . empty_c3 'c'
State 7:
0 $accept: start $end .
<- 0 $accept: start . $end
State 8:
2 start: empty_a 'a' .
<- 2 start: empty_a . 'a'
State 9:
4 start: empty_b 'b' .
<- 4 start: empty_b . 'b'
State 10:
6 start: empty_c1 'c' .
<- 6 start: empty_c1 . 'c'
State 11:
7 start: empty_c2 'c' .
<- 7 start: empty_c2 . 'c'
State 12:
8 start: empty_c3 'c' .
<- 8 start: empty_c3 . 'c'
FIRSTS
$accept firsts
'a'
'b'
'c'
start firsts
'a'
'b'
'c'
empty_a firsts
empty_b firsts
empty_c1 firsts
empty_c2 firsts
empty_c3 firsts
input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
input.y:4.5-7: warning: rule useless in parser due to conflicts [-Wother]
4 | 'a'
| ^~~
input.y:6.5-7: warning: rule useless in parser due to conflicts [-Wother]
6 | | 'b'
| ^~~
input.y:8.5-7: warning: rule useless in parser due to conflicts [-Wother]
8 | | 'c'
| ^~~
input.y:13.10-18: warning: rule useless in parser due to conflicts [-Wother]
13 | empty_a: %prec 'a' ;
| ^~~~~~~~~
input.y:14.10-18: warning: rule useless in parser due to conflicts [-Wother]
14 | empty_b: %prec 'b' ;
| ^~~~~~~~~
input.y:15.11-19: warning: rule useless in parser due to conflicts [-Wother]
15 | empty_c1: %prec 'c' ;
| ^~~~~~~~~
input.y:16.11-19: warning: rule useless in parser due to conflicts [-Wother]
16 | empty_c2: %prec 'c' ;
| ^~~~~~~~~
input.y:17.11-19: warning: rule useless in parser due to conflicts [-Wother]
17 | empty_c3: %prec 'c' ;
| ^~~~~~~~~
REDUCE ITEM PATH:
0 $accept: . start $end
7 start: . empty_c2 'c'
12 empty_c2: %empty .
CONFLICT 1 (size 1 depth 0 rc 2)
12 empty_c2: %empty .
12 empty_c2: %empty .
.
CONFLICT 2 (size 1 depth 0 rc 2)
13 empty_c3: %empty .
13 empty_c3: %empty .
.
CONFLICT 1 (size 2 depth -1 rc 4)
7 start: . empty_c2 'c'
7 start: empty_c2 . 'c'
empty_c2
`-> 12: %empty .
CONFLICT 2 (size 1 depth 0 rc 3)
13 empty_c3: %empty .
13 empty_c3: %empty .
.
CONFLICT 1 (size 1 depth 0 rc 3)
12 empty_c2: %empty .
12 empty_c2: %empty .
.
CONFLICT 2 (size 2 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 . 'c'
empty_c3
`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 3)
7 start: . empty_c2 'c'
7 start: empty_c2 . 'c'
empty_c2
`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 . 'c'
empty_c3
`-> 13: %empty .
CONFLICT 1 (size 3 depth -1 rc 2)
7 start: . empty_c2 'c'
7 start: empty_c2 'c' .
empty_c2
`-> 12: %empty .
CONFLICT 2 (size 3 depth -1 rc 2)
8 start: . empty_c3 'c'
8 start: empty_c3 'c' .
empty_c3
`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 4)
0 $accept: . start $end
0 $accept: start . $end
start
`-> 7: empty_c2 'c'
`-> 12: %empty .
CONFLICT 2 (size 3 depth -1 rc 3)
8 start: . empty_c3 'c'
8 start: empty_c3 'c' .
empty_c3
`-> 13: %empty .
CONFLICT 1 (size 3 depth -1 rc 3)
7 start: . empty_c2 'c'
7 start: empty_c2 'c' .
empty_c2
`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
0 $accept: . start $end
0 $accept: start . $end
start
`-> 8: empty_c3 'c'
`-> 13: %empty .
CONFLICT 1 (size 2 depth -1 rc 3)
0 $accept: . start $end
0 $accept: start . $end
start
`-> 7: empty_c2 'c'
`-> 12: %empty .
CONFLICT 2 (size 2 depth -1 rc 2)
0 $accept: . start $end
0 $accept: start . $end
start
`-> 8: empty_c3 'c'
`-> 13: %empty .
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:1959"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=error" "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Wnone,none -Werror --trace=none" "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:1959: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=none -Werror --trace=none" "conflicts.at:1959"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --trace=cex -fcaret --report=all -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:1959"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2239: cat input.output | sed -n '/^State 0\$/,/^State 1\$/p'"
at_fn_check_prepare_notrace 'a shell pipeline' "conflicts.at:2239"
( $at_check_trace; cat input.output | sed -n '/^State 0$/,/^State 1$/p'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "State 0
0 \$accept: . start \$end
1 start: . 'a'
2 | . empty_a 'a'
3 | . 'b'
4 | . empty_b 'b'
5 | . 'c'
6 | . empty_c1 'c'
7 | . empty_c2 'c'
8 | . empty_c3 'c'
9 empty_a: %empty . []
10 empty_b: %empty . []
11 empty_c1: %empty . []
12 empty_c2: %empty . ['c']
13 empty_c3: %empty . ['c']
'a' error (nonassociative)
'b' error (nonassociative)
'c' error (nonassociative)
'c' [reduce using rule 12 (empty_c2)]
'c' [reduce using rule 13 (empty_c3)]
start go to state 1
empty_a go to state 2
empty_b go to state 3
empty_c1 go to state 4
empty_c2 go to state 5
empty_c3 go to state 6
Conflict between rule 9 and token 'a' resolved as an error (%nonassoc 'a').
Conflict between rule 10 and token 'b' resolved as an error (%nonassoc 'b').
Conflict between rule 11 and token 'c' resolved as an error (%nonassoc 'c').
reduce/reduce conflict on token 'c':
12 empty_c2: %empty .
13 empty_c3: %empty .
Example: . 'c'
First reduce derivation
start
\`-> 7: empty_c2 'c'
\`-> 12: %empty .
Second reduce derivation
start
\`-> 8: empty_c3 'c'
\`-> 13: %empty .
State 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2239"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_256
#AT_START_257
at_fn_group_banner 257 'conflicts.at:2299' \
"%expect-rr non GLR" " " 10
at_xfail=no
(
printf "%s\n" "257. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >1.y <<'_ATEOF'
%expect-rr 0
%%
exp: 'a'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv 1.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y" "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2307"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2307"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2307"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret 1.y"
at_fn_check_prepare_trace "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.y: warning: %expect-rr applies only to GLR parsers [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror" "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
1.y: warning: %expect-rr applies only to GLR parsers [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:2307"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error" "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none" "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2307: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none" "conflicts.at:2307"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 1.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2307"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >2.y <<'_ATEOF'
%expect-rr 1
%%
exp: 'a' | 'a';
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y" "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2317"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2317"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2317"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret 2.y"
at_fn_check_prepare_trace "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "2.y: warning: %expect-rr applies only to GLR parsers [-Wother]
2.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
2.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
2.y:3.12-14: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror" "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
2.y: warning: %expect-rr applies only to GLR parsers [-Wother]
2.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
2.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
2.y:3.12-14: warning: rule useless in parser due to conflicts [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:2317"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error" "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none" "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2317: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none" "conflicts.at:2317"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret 2.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2317"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_257
#AT_START_258
at_fn_group_banner 258 'conflicts.at:2331' \
"-W versus %expect and %expect-rr" " " 10
at_xfail=no
(
printf "%s\n" "258. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >sr-rr.y <<'_ATEOF'
%glr-parser
%%
start: 'a' | A 'a' | B 'a' ;
A: ;
B: ;
_ATEOF
cat >sr.y <<'_ATEOF'
%glr-parser
%%
start: 'a' | A 'a' ;
A: ;
_ATEOF
cat >rr.y <<'_ATEOF'
%glr-parser
%%
start: A | B ;
A: ;
B: ;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y" "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2354"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2354"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2354"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
sr-rr.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror" "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
sr-rr.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:2354"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error" "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:2354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret sr-rr.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2354"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-conflicts-sr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y" "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-sr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2359"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2359"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2359"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
sr-rr.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror" "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
sr-rr.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
sr-rr.y: note: rerun with option '-Wcounterexamples' to generate conflict counterexamples
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:2359"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error" "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2359: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:2359"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-sr sr-rr.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2359"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-conflicts-rr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y" "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-conflicts-rr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2363"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y"
at_fn_check_prepare_trace "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror" "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
sr-rr.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "conflicts.at:2363"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error" "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none" "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none" "conflicts.at:2363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wno-conflicts-rr sr-rr.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2363"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# This is piece of code is rather complex for a simple task: try every
# combination of (0 or 1 real SR) x (0 or 1 real RR) x (don't %expect
# or %expect 0, 1, or 2 SR) x (don't %expect-rr or %expect-rr 0, 1, or 2
# RR).
# Number and types of genuine conflicts in the grammar.
for gram in sr-rr sr rr; do
# Number of expected s/r conflicts.
for sr_exp_i in '' 0 1 2; do
# Number of expected r/r conflicts.
for rr_exp_i in '' 0 1 2; do
test -z "$sr_exp_i" && test -z "$rr_exp_i" && continue
# Build grammar file.
sr_exp=0
rr_exp=0
file=$gram
directives=
if test -n "$sr_exp_i"; then
sr_exp=$sr_exp_i
file=$file-expect-$sr_exp
directives="%expect $sr_exp"
fi
if test -n "$rr_exp_i"; then
rr_exp=$rr_exp_i
file=$file-expect-rr-$rr_exp
directives="$directives %expect-rr $rr_exp"
fi
file=$file.y
echo "$directives" > $file
cat $gram.y >> $file
# Number of found conflicts.
case $gram in
(sr) sr_count=1; rr_count=0;;
(rr) sr_count=0; rr_count=1;;
(sr-rr) sr_count=1; rr_count=1;;
esac
# Update number of expected conflicts: if %expect is given then
# %expect-rr defaults to 0, and vice-versa. Leave empty if
# nothing expected.
case $sr_exp_i:$rr_exp_i in
?:) rr_exp_i=0;;
:?) sr_exp_i=0;;
esac
# Run tests.
if test $sr_count -eq $sr_exp && test $rr_count -eq $rr_exp; then
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wnone \$file"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wnone $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone $file" "conflicts.at:2417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wnone $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2417"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2417"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2417"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wnone \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wnone $file" "conflicts.at:2417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wnone $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2417"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Werror \$file"
at_fn_check_prepare_notrace 'an embedded newline' "conflicts.at:2418"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Werror $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror $file" "conflicts.at:2418"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Werror $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2418"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "conflicts.at:2418"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "conflicts.at:2418"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2418: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror $file" "conflicts.at:2418"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Werror $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/conflicts.at:2418"
$at_failed && at_fn_log_failure
$at_traceon; }
else
{
issue_note=false
if test -z "$sr_exp_i" && test "$sr_count" -ne 0; then
echo "warning: $sr_count shift/reduce conflicts"
issue_note=true
elif test "$sr_exp_i" -ne "$sr_count"; then
echo "error: shift/reduce conflicts: $sr_count found, $sr_exp_i expected"
if test "$sr_count" -ne 0; then
issue_note=true
fi
fi
if test -z "$rr_exp_i" && test "$rr_count" -ne 0; then
echo "warning: $rr_count reduce/reduce conflicts"
issue_note=true
elif test "$rr_exp_i" -ne "$rr_count"; then
echo "error: reduce/reduce conflicts: $rr_count found, $rr_exp_i expected"
if test "$rr_count" -ne 0; then
issue_note=true
fi
fi
if $issue_note; then
echo "note: rerun with option '-Wcounterexamples' to generate conflict counterexamples"
fi
} | sed -e "s/^/$file: /" > experr
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2444: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone $file" "conflicts.at:2444"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Wnone $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2444"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/conflicts.at:2445: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror \$file"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror $file" "conflicts.at:2445"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -Werror $file
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/conflicts.at:2445"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
done
done
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_258
#AT_START_259
at_fn_group_banner 259 'counterexample.at:43' \
"Unifying S/R" " " 11
at_xfail=no
(
printf "%s\n" "259. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B C
%%
s: a x | y c;
a: A;
c: C;
x: B | B C;
y: A | A B;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:55"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:55"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:55"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:55"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:55"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:55"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:55"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: A . B C
Shift derivation
s
\`-> 2: y c
\`-> 8: A . B \`-> 4: C
Reduce derivation
s
\`-> 1: a x
\`-> 3: A . \`-> 6: B C
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:55"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:55"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:55"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:55"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:55"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:55"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:55: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:55"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example A . B C
Shift derivation s -> [ y -> [ A . B ] c -> [ C ] ]
Reduce derivation s -> [ a -> [ A . ] x -> [ B C ] ]
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:55"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_259
#AT_START_260
at_fn_group_banner 260 'counterexample.at:83' \
"Deep Unifying S/R" " " 11
at_xfail=no
(
printf "%s\n" "260. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B C
%%
s: ac | a bc;
ac: A ac C | b;
b: B | B b;
a: A | A a;
bc: B bc C | B C;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:95"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:95"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:95"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:95"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:95"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: A . B C
Shift derivation
s
\`-> 1: ac
\`-> 3: A ac C
\`-> 4: b
\`-> 5: . B
Reduce derivation
s
\`-> 2: a bc
\`-> 7: A . \`-> 10: B C
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: A A . B B C C
Shift derivation
s
\`-> 1: ac
\`-> 3: A ac C
\`-> 3: A ac C
\`-> 4: b
\`-> 6: . b
\`-> 5: B B
Reduce derivation
s
\`-> 2: a bc
\`-> 8: A a \`-> 9: B bc C
\`-> 7: A . \`-> 10: B C
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:95"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:95"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:95"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:95"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:95"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:95"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:95: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:95"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example A . B C
Shift derivation s -> [ ac -> [ A ac -> [ b -> [ . B ] ] C ] ]
Reduce derivation s -> [ a -> [ A . ] bc -> [ B C ] ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example A A . B B C C
Shift derivation s -> [ ac -> [ A ac -> [ A ac -> [ b -> [ . b -> [ B B ] ] ] C ] C ] ]
Reduce derivation s -> [ a -> [ A a -> [ A . ] ] bc -> [ B bc -> [ B C ] C ] ]
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:95"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_260
#AT_START_261
at_fn_group_banner 261 'counterexample.at:144' \
"S/R Conflict with Nullable Symbols" " " 11
at_xfail=no
(
printf "%s\n" "261. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B X Y
%%
s: ax by | A xby;
ax: A x;
x: %empty | X x;
by: B y;
y: %empty | Y y;
xby: B | X xby Y;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:157"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:157"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:157"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:157"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:157"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:157"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:157"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: A . B
Shift derivation
s
\`-> 2: A xby
\`-> 9: . B
Reduce derivation
s
\`-> 1: ax by
\`-> 3: A x \`-> 6: B y
\`-> 4: %empty . \`-> 6: %empty
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
First example: A X . B Y \$end
Shift derivation
\$accept
\`-> 0: s \$end
\`-> 2: A xby
\`-> 10: X xby Y
\`-> 9: . B
Second example: A X . B y \$end
Reduce derivation
\$accept
\`-> 0: s \$end
\`-> 1: ax by
\`-> 3: A x \`-> 6: B y
\`-> 5: X x
\`-> 4: %empty .
input.y:5.4-9: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:157"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:157"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:157"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:157"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:157"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:157"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:157: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:157"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example A . B
Shift derivation s -> [ A xby -> [ . B ] ]
Reduce derivation s -> [ ax -> [ A x -> [ . ] ] by -> [ B y -> [ ] ] ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
First example A X . B Y \$end
Shift derivation \$accept -> [ s -> [ A xby -> [ X xby -> [ . B ] Y ] ] \$end ]
Second example A X . B y \$end
Reduce derivation \$accept -> [ s -> [ ax -> [ A x -> [ X x -> [ . ] ] ] by -> [ B y ] ] \$end ]
input.y:5.4-9: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:157"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_261
#AT_START_262
at_fn_group_banner 262 'counterexample.at:207' \
"Non-unifying Ambiguous S/R" " " 11
at_xfail=no
(
printf "%s\n" "262. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B C D E
%%
g: s | x;
s: A x E | A x D E;
x: b cd | bc;
b: B;
cd: C D;
bc: B C;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:220"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:220"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:220"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:220"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:220"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
First example: B . C \$end
Shift derivation
\$accept
\`-> 0: g \$end
\`-> 2: x
\`-> 6: bc
\`-> 9: B . C
Second example: B . C D \$end
Reduce derivation
\$accept
\`-> 0: g \$end
\`-> 2: x
\`-> 5: b cd
\`-> 7: B . \`-> 8: C D
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:220"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:220"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:220"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:220"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:220"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:220"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:220: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:220"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token C [-Wcounterexamples]
First example B . C \$end
Shift derivation \$accept -> [ g -> [ x -> [ bc -> [ B . C ] ] ] \$end ]
Second example B . C D \$end
Reduce derivation \$accept -> [ g -> [ x -> [ b -> [ B . ] cd -> [ C D ] ] ] \$end ]
input.y:6.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:220"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_262
#AT_START_263
at_fn_group_banner 263 'counterexample.at:254' \
"Non-unifying Unambiguous S/R" " " 11
at_xfail=no
(
printf "%s\n" "263. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B
%%
s: t | s t;
t: x | y;
x: A;
y: A A B;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:265"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:265"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:265"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:265"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:265"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:265"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:265"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
First example: A . A B \$end
Shift derivation
\$accept
\`-> 0: s \$end
\`-> 1: t
\`-> 4: y
\`-> 6: A . A B
Second example: A . A \$end
Reduce derivation
\$accept
\`-> 0: s \$end
\`-> 2: s t
\`-> 1: t \`-> 3: x
\`-> 3: x \`-> 5: A
\`-> 5: A .
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:265"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:265"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:265"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:265"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:265"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:265"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:265: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:265"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
First example A . A B \$end
Shift derivation \$accept -> [ s -> [ t -> [ y -> [ A . A B ] ] ] \$end ]
Second example A . A \$end
Reduce derivation \$accept -> [ s -> [ s -> [ t -> [ x -> [ A . ] ] ] t -> [ x -> [ A ] ] ] \$end ]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:265"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_263
#AT_START_264
at_fn_group_banner 264 'counterexample.at:298' \
"S/R after first token" " " 11
at_xfail=no
(
printf "%s\n" "264. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B X Y
%%
a: r t | s;
r: b;
b: B;
t: A xx | A x xy;
s: b A xx y;
x: X;
xx: X X;
xy: X Y;
y: Y;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:314"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:314"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:314"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:314"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:314"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:314"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:314"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
Example: b . A X X Y
Shift derivation
a
\`-> 2: s
\`-> 7: b . xx y
\`-> 9: A X X \`-> 11: Y
Reduce derivation
a
\`-> 1: r t
\`-> 3: b . \`-> 6: A x xy
\`-> 8: X \`-> 10: X Y
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
First example: A X . X
Shift derivation
a
\`-> 1: t
\`-> 5: A xx
\`-> 9: X . X
Second example: X . X xy
Reduce derivation
a
\`-> 1: x t
\`-> 8: X . \`-> 6: X xy
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:314"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:314"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:314"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:314"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:314"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:314"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:314: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:314"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 shift/reduce conflicts [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
Example b . A X X Y
Shift derivation a -> [ s -> [ b . xx -> [ A X X ] y -> [ Y ] ] ]
Reduce derivation a -> [ r -> [ b . ] t -> [ A x -> [ X ] xy -> [ X Y ] ] ]
input.y: warning: shift/reduce conflict on token X [-Wcounterexamples]
First example A X . X
Shift derivation a -> [ t -> [ A xx -> [ X . X ] ] ]
Second example X . X xy
Reduce derivation a -> [ x -> [ X . ] t -> [ X xy ] ]
input.y:4.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:8.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:314"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_264
#AT_START_265
at_fn_group_banner 265 'counterexample.at:363' \
"Unifying R/R counterexample" " " 11
at_xfail=no
(
printf "%s\n" "265. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A
%%
a : A b ;
b : A | b;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:372"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:372"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example: A b .
First reduce derivation
a
\`-> 1: A b .
Second reduce derivation
a
\`-> 1: A b
\`-> 3: b .
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:372"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:372"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:372"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:372"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:372"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:372"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:372: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:372"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 reduce/reduce conflict [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example A b .
First reduce derivation a -> [ A b . ]
Second reduce derivation a -> [ A b -> [ b . ] ]
input.y:4.9: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_265
#AT_START_266
at_fn_group_banner 266 'counterexample.at:399' \
"Non-unifying R/R LR(1) conflict" " " 11
at_xfail=no
(
printf "%s\n" "266. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A B C D
%%
s: a A | B a C | b C | B b A;
a: D;
b: D;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:409"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:409"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:409"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:409"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on tokens A, C [-Wcounterexamples]
First example: D . A \$end
First reduce derivation
\$accept
\`-> 0: s \$end
\`-> 1: a A
\`-> 5: D .
Second example: B D . A \$end
Second reduce derivation
\$accept
\`-> 0: s \$end
\`-> 4: B b A
\`-> 6: D .
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:409"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:409"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:409"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:409"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:409"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:409"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:409: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:409"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 2 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on tokens A, C [-Wcounterexamples]
First example D . A \$end
First reduce derivation \$accept -> [ s -> [ a -> [ D . ] A ] \$end ]
Second example B D . A \$end
Second reduce derivation \$accept -> [ s -> [ B b -> [ D . ] A ] \$end ]
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:409"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_266
#AT_START_267
at_fn_group_banner 267 'counterexample.at:441' \
"Non-unifying R/R LR(2) conflict" " " 11
at_xfail=no
(
printf "%s\n" "267. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token H J K X
%%
s: a J;
a: H i;
i: X | i J K;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:451"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:451"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:451"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:451"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:451"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:451"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:451"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
time limit exceeded: XXX
First example: H i . J K \$end
Shift derivation
\$accept
\`-> 0: a \$end
\`-> 2: H i
\`-> 4: i . J K
Second example: H i . J \$end
Reduce derivation
\$accept
\`-> 0: s \$end
\`-> 1: a J
\`-> 2: H i .
input.y:4.4-6: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:451"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:451"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:451"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:451"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:451"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:451"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:451: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:451"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
time limit exceeded: XXX
First example H i . J K \$end
Shift derivation \$accept -> [ a -> [ H i -> [ i . J K ] ] \$end ]
Second example H i . J \$end
Reduce derivation \$accept -> [ s -> [ a -> [ H i . ] J ] \$end ]
input.y:4.4-6: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:451"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_267
#AT_START_268
at_fn_group_banner 268 'counterexample.at:488' \
"Cex Search Prepend" " " 11
at_xfail=no
(
printf "%s\n" "268. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token N A B C D
%%
s: n | n C;
n: N n D | N n C | N a B | N b;
a: A;
b: A B C | A B D;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:499"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:499"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:499"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:499"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:499"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:499"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:499"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: N A . B C
Shift derivation
s
\`-> 1: n
\`-> 6: N b
\`-> 8: A . B C
Reduce derivation
s
\`-> 2: n C
\`-> 5: N a B
\`-> 7: A .
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example: N N A . B D C
Shift derivation
s
\`-> 1: n
\`-> 4: N n C
\`-> 6: N b
\`-> 9: A . B D
Reduce derivation
s
\`-> 2: n C
\`-> 3: N n D
\`-> 5: N a B
\`-> 7: A .
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:499"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:499"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:499"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:499"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:499"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:499"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:499: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:499"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example N A . B C
Shift derivation s -> [ n -> [ N b -> [ A . B C ] ] ]
Reduce derivation s -> [ n -> [ N a -> [ A . ] B ] C ]
input.y: warning: shift/reduce conflict on token B [-Wcounterexamples]
Example N N A . B D C
Shift derivation s -> [ n -> [ N n -> [ N b -> [ A . B D ] ] C ] ]
Reduce derivation s -> [ n -> [ N n -> [ N a -> [ A . ] B ] D ] C ]
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:499"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_268
#AT_START_269
at_fn_group_banner 269 'counterexample.at:550' \
"R/R cex with prec" " " 11
at_xfail=no
(
printf "%s\n" "269. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%left b
%right c
%%
S: B C | C B;
A : B | C | %empty;
B : A b A;
C : A c A;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:562"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:562"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:562"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:562"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 4 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example: B . b c
First reduce derivation
S
\`-> 1: B C
\`-> 6: A b A \`-> 7: A c A
\`-> 3: B . \`-> 6: %empty \`-> 7: %empty \`-> 7: %empty
Second reduce derivation
S
\`-> 1: B C
\`-> 7: A c A
\`-> 3: B \`-> 7: %empty
\`-> 6: A b A
\`-> 5: %empty . \`-> 6: %empty
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example: C . c b
First reduce derivation
S
\`-> 2: C B
\`-> 7: A c A \`-> 6: A b A
\`-> 4: C . \`-> 7: %empty \`-> 6: %empty \`-> 6: %empty
Second reduce derivation
S
\`-> 2: C B
\`-> 6: A b A
\`-> 4: C \`-> 6: %empty
\`-> 7: A c A
\`-> 5: %empty . \`-> 7: %empty
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:562"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:562"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:562"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:562"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:562"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:562"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:562: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:562"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 4 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example B . b c
First reduce derivation S -> [ B -> [ A -> [ B . ] b A -> [ ] ] C -> [ A -> [ ] c A -> [ ] ] ]
Second reduce derivation S -> [ B C -> [ A -> [ B -> [ A -> [ . ] b A -> [ ] ] ] c A -> [ ] ] ]
input.y: warning: reduce/reduce conflict on tokens b, c [-Wcounterexamples]
Example C . c b
First reduce derivation S -> [ C -> [ A -> [ C . ] c A -> [ ] ] B -> [ A -> [ ] b A -> [ ] ] ]
Second reduce derivation S -> [ C B -> [ A -> [ C -> [ A -> [ . ] c A -> [ ] ] ] b A -> [ ] ] ]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_269
#AT_START_270
at_fn_group_banner 270 'counterexample.at:610' \
"Null nonterminals" " " 11
at_xfail=no
(
printf "%s\n" "270. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A
%%
a : b d | c d ;
b : ;
c : ;
d : a | c A | d;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:621"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:621"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:621"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:621"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:621"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:621"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:621"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: 6 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example: . c A A \$end
First reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 3: %empty . \`-> 6: c A A
Second example: . c A A \$end
Second reduce derivation
\$accept
\`-> 0: a \$end
\`-> 2: c d
\`-> 4: %empty . \`-> 6: c A A
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example: b . c A A \$end
First reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 5: a
\`-> 1: b d
\`-> 3: %empty . \`-> 6: c A A
Second example: b . A \$end
Second reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 6: c A
\`-> 4: %empty .
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example: c . c A A \$end
First reduce derivation
\$accept
\`-> 0: a \$end
\`-> 2: c d
\`-> 5: a
\`-> 1: b d
\`-> 3: %empty . \`-> 6: c A A
Second example: c . A \$end
Second reduce derivation
\$accept
\`-> 0: a \$end
\`-> 2: c d
\`-> 6: c A
\`-> 4: %empty .
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example: b c . A
Shift derivation
a
\`-> 1: b d
\`-> 6: c . A
Second example: b c . c A A \$end
Reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 5: a
\`-> 2: c d
\`-> 5: a
\`-> 1: b d
\`-> 3: %empty . \`-> 6: c A A
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example: b c . c A A \$end
First reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 5: a
\`-> 2: c d
\`-> 5: a
\`-> 1: b d
\`-> 3: %empty . \`-> 6: c A A
Second example: b c . A \$end
Second reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 5: a
\`-> 2: c d
\`-> 6: c A
\`-> 4: %empty .
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
First example: b c . A
Shift derivation
a
\`-> 1: b d
\`-> 6: c . A
Second example: b c . A \$end
Reduce derivation
\$accept
\`-> 0: a \$end
\`-> 1: b d
\`-> 5: a
\`-> 2: c d
\`-> 6: c A
\`-> 4: %empty .
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example: b d .
First reduce derivation
a
\`-> 1: b d .
Second reduce derivation
a
\`-> 1: b d
\`-> 7: d .
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example: c d .
First reduce derivation
a
\`-> 2: c d .
Second reduce derivation
a
\`-> 2: c d
\`-> 7: d .
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:6.15: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:621"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:621"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:621"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:621"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:621"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:621"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:621: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:621"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: 6 reduce/reduce conflicts [-Wconflicts-rr]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example . c A A \$end
First reduce derivation \$accept -> [ a -> [ b -> [ . ] d -> [ c A A ] ] \$end ]
Second example . c A A \$end
Second reduce derivation \$accept -> [ a -> [ c -> [ . ] d -> [ c A A ] ] \$end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example b . c A A \$end
First reduce derivation \$accept -> [ a -> [ b d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] \$end ]
Second example b . A \$end
Second reduce derivation \$accept -> [ a -> [ b d -> [ c -> [ . ] A ] ] \$end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example c . c A A \$end
First reduce derivation \$accept -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] \$end ]
Second example c . A \$end
Second reduce derivation \$accept -> [ a -> [ c d -> [ c -> [ . ] A ] ] \$end ]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
time limit exceeded: XXX
First example b c . A
Shift derivation a -> [ b d -> [ c . A ] ]
Second example b c . c A A \$end
Reduce derivation \$accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] \$end ]
input.y: warning: reduce/reduce conflict on token A [-Wcounterexamples]
First example b c . c A A \$end
First reduce derivation \$accept -> [ a -> [ b d -> [ a -> [ c d -> [ a -> [ b -> [ . ] d -> [ c A A ] ] ] ] ] ] \$end ]
Second example b c . A \$end
Second reduce derivation \$accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] \$end ]
input.y: warning: shift/reduce conflict on token A [-Wcounterexamples]
First example b c . A
Shift derivation a -> [ b d -> [ c . A ] ]
Second example b c . A \$end
Reduce derivation \$accept -> [ a -> [ b d -> [ a -> [ c d -> [ c -> [ . ] A ] ] ] ] \$end ]
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example b d .
First reduce derivation a -> [ b d . ]
Second reduce derivation a -> [ b d -> [ d . ] ]
input.y: warning: reduce/reduce conflict on token \$end [-Wcounterexamples]
Example c d .
First reduce derivation a -> [ c d . ]
Second reduce derivation a -> [ c d -> [ d . ] ]
input.y:5.4: warning: rule useless in parser due to conflicts [-Wother]
input.y:6.15: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:621"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_270
#AT_START_271
at_fn_group_banner 271 'counterexample.at:797' \
"Non-unifying Prefix Share" " " 11
at_xfail=no
(
printf "%s\n" "271. $at_setup_line: testing $at_desc ..."
$at_traceon
# Tests for a counterexample which should start its derivation
# at a shared symbol rather than the start symbol.
cat >input.y <<'_ATEOF'
%token H J
%%
s: a | a J;
a: H i J J
i: %empty | i J;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:810"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:810"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:810"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:810"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:810"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:810"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:810"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
Example: H i J . J J
Shift derivation
s
\`-> 2: a J
\`-> 3: H i J . J
Reduce derivation
s
\`-> 1: a
\`-> 3: H i J J
\`-> 5: i J .
input.y:5.13-15: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:810"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:810"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:810"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:810"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:810"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:810"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:810: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:810"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token J [-Wcounterexamples]
Example H i J . J J
Shift derivation s -> [ a -> [ H i J . J ] J ]
Reduce derivation s -> [ a -> [ H i -> [ i J . ] J J ] ]
input.y:5.13-15: warning: rule useless in parser due to conflicts [-Wother]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:810"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_271
#AT_START_272
at_fn_group_banner 272 'counterexample.at:842' \
"Deep Null Unifying" " " 11
at_xfail=no
(
printf "%s\n" "272. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A D
%%
s: A a d | A a a d;
a: b;
b: c
c: %empty
d: D;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:854"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:854"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:854"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:854"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:854"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:854"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:854"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
Example: A a . D
Shift derivation
s
\`-> 1: A a d
\`-> 6: . D
Reduce derivation
s
\`-> 2: A a a d
\`-> 3: b \`-> 6: D
\`-> 4: c
\`-> 5: %empty .
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:854"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:854"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:854"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:854"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:854"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:854"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:854: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:854"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
Example A a . D
Shift derivation s -> [ A a d -> [ . D ] ]
Reduce derivation s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] ]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:854"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_272
#AT_START_273
at_fn_group_banner 273 'counterexample.at:884' \
"Deep Null Non-unifying" " " 11
at_xfail=no
(
printf "%s\n" "273. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%token A D E
%%
s: A a d | A a a d E;
a: b;
b: c
c: %empty
d: D;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:896"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:896"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:896"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:896"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:896"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:896"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
# FIXME: Avoid trailing white spaces.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *\$//;' stderr"
at_fn_check_prepare_dynamic "sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr" "counterexample.at:896"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g;s/ *$//;' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
First example: A a . D \$end
Shift derivation
\$accept
\`-> 0: s \$end
\`-> 1: A a d
\`-> 6: . D
Second example: A a . D E \$end
Reduce derivation
\$accept
\`-> 0: s \$end
\`-> 2: A a a d E
\`-> 3: b \`-> 6: D
\`-> 4: c
\`-> 5: %empty .
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wcounterexamples input.y"
at_fn_check_prepare_notrace 'an embedded newline' "counterexample.at:896"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y"
at_fn_check_prepare_dynamic "YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y" "counterexample.at:896"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:896"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "counterexample.at:896"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: \$XSLTPROC \\
\`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "counterexample.at:896"
( $at_check_trace; $XSLTPROC \
`YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y"
at_fn_check_prepare_trace "counterexample.at:896"
( $at_check_trace; YYFLAT=1; export YYFLAT;COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wcounterexamples input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/counterexample.at:896: sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr"
at_fn_check_prepare_trace "counterexample.at:896"
( $at_check_trace; sed -e 's/time limit exceeded: [0-9][.0-9]*/time limit exceeded: XXX/g' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y: warning: 1 shift/reduce conflict [-Wconflicts-sr]
input.y: warning: shift/reduce conflict on token D [-Wcounterexamples]
First example A a . D \$end
Shift derivation \$accept -> [ s -> [ A a d -> [ . D ] ] \$end ]
Second example A a . D E \$end
Reduce derivation \$accept -> [ s -> [ A a a -> [ b -> [ c -> [ . ] ] ] d -> [ D ] E ] \$end ]
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/counterexample.at:896"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_273
#AT_START_274
at_fn_group_banner 274 'synclines.at:194' \
"Prologue syncline" " " 12
at_xfail=no
(
printf "%s\n" "274. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%{
#error "2"
%}
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
exp: '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:194"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:194"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:194"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:194"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:194"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:194"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:194"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:194"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:194"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:194: cat stdout"
at_fn_check_prepare_trace "synclines.at:194"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:2: #error \"2\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:194"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_274
#AT_START_275
at_fn_group_banner 275 'synclines.at:214' \
"%union syncline" " " 12
at_xfail=no
(
printf "%s\n" "275. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%union {
#error "2"
char dummy;
}
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
exp: '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:214"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:214"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:214"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:214"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:214"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:214"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:214"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:214"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:214"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:214: cat stdout"
at_fn_check_prepare_trace "synclines.at:214"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:2: #error \"2\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:214"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_275
#AT_START_276
at_fn_group_banner 276 'synclines.at:237' \
"%union name syncline" " " 12
at_xfail=no
(
printf "%s\n" "276. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%union break
{
char dummy;
}
%code {
void yyerror (const char *msg);
int yylex (void);
%}
%%
exp: '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:253"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:253"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:253"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:253: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:253"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:253"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:254: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:254"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:254: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:254"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:254: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:254"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:254: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:254"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:254: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:254"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:254"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:255: grep '^input.y:1' stdout"
at_fn_check_prepare_trace "synclines.at:255"
( $at_check_trace; grep '^input.y:1' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:255"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_276
#AT_START_277
at_fn_group_banner 277 'synclines.at:264' \
"Postprologue syncline" " " 12
at_xfail=no
(
printf "%s\n" "277. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%{
/* Preprologue. */
%}
%union
{
int ival;
}
%{
#error "13"
%}
%%
exp: '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:264"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:264"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:264"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:264"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:264"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:264"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:264"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:264"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:264"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:264"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:264"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:264: cat stdout"
at_fn_check_prepare_trace "synclines.at:264"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:13: #error \"13\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:264"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_277
#AT_START_278
at_fn_group_banner 278 'synclines.at:291' \
"Action syncline" " " 12
at_xfail=no
(
printf "%s\n" "278. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
exp:
{
#error "8"
};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:291"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:291"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:291"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:291"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:291"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:291"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:291"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:291"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:291"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:291: cat stdout"
at_fn_check_prepare_trace "synclines.at:291"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:8: #error \"8\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:291"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_278
#AT_START_279
at_fn_group_banner 279 'synclines.at:310' \
"Epilogue syncline" " " 12
at_xfail=no
(
printf "%s\n" "279. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
exp: '0';
%%
#error "8"
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:310"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:310"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:310"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:310"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:310"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:310"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:310"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:310"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:310"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:310"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:310"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:310: cat stdout"
at_fn_check_prepare_trace "synclines.at:310"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:8: #error \"8\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:310"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_279
#AT_START_280
at_fn_group_banner 280 'synclines.at:327' \
"%code top syncline" " " 12
at_xfail=no
(
printf "%s\n" "280. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top {
#error "2"
}
%code {
void yyerror (const char *msg);
int yylex (void);
}
%%
exp: '0';
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:327"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:327"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:327"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:327"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:327"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:327"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:327"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:327"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:327: cat stdout"
at_fn_check_prepare_trace "synclines.at:327"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:2: #error \"2\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_280
#AT_START_281
at_fn_group_banner 281 'synclines.at:346' \
"%destructor syncline" " " 12
at_xfail=no
(
printf "%s\n" "281. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%destructor {
#error "2"
} <ival>
%{
void yyerror (const char *msg);
int yylex (void);
%}
%union {
int ival;
}
%type <ival> exp
%%
exp: '0' { $$ = 0; };
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:346"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:346"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:346"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:346"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:346"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:346"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:346"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:346"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:346: cat stdout"
at_fn_check_prepare_trace "synclines.at:346"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:2: #error \"2\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:346"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_281
#AT_START_282
at_fn_group_banner 282 'synclines.at:370' \
"%printer syncline" " " 12
at_xfail=no
(
printf "%s\n" "282. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%printer {
#error "2"
} <ival>
%debug
%code {
void yyerror (const char *msg);
int yylex (void);
}
%union {
int ival;
}
%type <ival> exp
%%
exp: '0' { $$ = 0; };
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:370"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check if we can trust location translation.
cat >syncline.c <<'_ATEOF'
void foo (void);
void foo (void)
{
#error "4"
}
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \$CC \$CFLAGS \$CPPFLAGS -c syncline.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c syncline.c" "synclines.at:370"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c syncline.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:370"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: test \"\`cat stdout\`\" = 'syncline.c:4: #error \"4\"' || exit 77"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:370"
( $at_check_trace; test "`cat stdout`" = 'syncline.c:4: #error "4"' || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Then work for real.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \$CC \$CFLAGS \$CPPFLAGS -c input.c"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c input.c" "synclines.at:370"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: \"\$PERL\" -p -0777 - stderr <<\\EOF || exit 77
# Remove left-hand margin.
s/^[\\d ]{6}\\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\\[\\d+\\] .*\\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\\+\\+'.*\\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\\n *\\^~*\\n//gm;
# Number of errors.
s/^1 error generated\\.\\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., \"1540-0218 (S)\").
s/^\"(.*?)\", line ([\\w.]*): \\d+-\\d+ \\(.\\) /\$1:\$2: /gm;
# Remove column.
s/^([^:]+:\\d+)[.:][^:]+:(.+)\$/\$1:\$2/gm;
# Map all combinations of \"error: \" and \"#error: \" to \"#error \".
s/^([^:]+:\\d+):( |#error|error|:)+/\$1: #error /gm;
EOF
"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:370"
( $at_check_trace; "$PERL" -p -0777 - stderr <<\EOF || exit 77
# Remove left-hand margin.
s/^[\d ]{6}\| //gm;
# 1. Remove useless lines.
# distcc clutter.
s/^distcc\[\d+\] .*\n//gm;
# c vs. c++.
s/^clang: warning: treating 'c' input as 'c\+\+'.*\n//gm;
# Function context.
s/^[^:]*: In function '[^']+':\n//gm;
# Caret error (with possible '~' to underline).
s/^ *#error.*\n *\^~*\n//gm;
# Number of errors.
s/^1 error generated\.\n//gm;
# 2. Normalize the lines we kept.
# xlc messages. Remove also error identifier (e.g., "1540-0218 (S)").
s/^"(.*?)", line ([\w.]*): \d+-\d+ \(.\) /$1:$2: /gm;
# Remove column.
s/^([^:]+:\d+)[.:][^:]+:(.+)$/$1:$2/gm;
# Map all combinations of "error: " and "#error: " to "#error ".
s/^([^:]+:\d+):( |#error|error|:)+/$1: #error /gm;
EOF
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:370: cat stdout"
at_fn_check_prepare_trace "synclines.at:370"
( $at_check_trace; cat stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "input.y:2: #error \"2\"
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_282
#AT_START_283
at_fn_group_banner 283 'synclines.at:440' \
"syncline escapes: yacc.c" " " 12
at_xfail=no
(
printf "%s\n" "283. $at_setup_line: testing $at_desc ..."
$at_traceon
# ICC is unable to handle these file names: it fails to pass them
# properly to the linker, and is unable to save a file named this way.
# Don't try with such compilers.
cat >\"\\\"\".c <<'_ATEOF'
int main (void) { return 0; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS \"\\\"\".c -o \"\\\"\" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >\"\\\"\".y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c"
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%destructor {} <>
%printer {} <>
%%
exp: '0'
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Maybe we tried to create a file name that the file system does not
# support.
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test ! -f \"\\\"\".y) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c $LIBS" "synclines.at:440"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_283
#AT_START_284
at_fn_group_banner 284 'synclines.at:440' \
"syncline escapes: glr.c" " " 12
at_xfail=no
(
printf "%s\n" "284. $at_setup_line: testing $at_desc ..."
$at_traceon
# ICC is unable to handle these file names: it fails to pass them
# properly to the linker, and is unable to save a file named this way.
# Don't try with such compilers.
cat >\"\\\"\".c <<'_ATEOF'
int main (void) { return 0; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".c -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS \"\\\"\".c -o \"\\\"\" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >\"\\\"\".y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.c"
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%destructor {} <>
%printer {} <>
%%
exp: '0'
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Maybe we tried to create a file name that the file system does not
# support.
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test ! -f \"\\\"\".y) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y" "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".c \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\"\".c \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".c $LIBS" "synclines.at:440"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_284
#AT_START_285
at_fn_group_banner 285 'synclines.at:440' \
"syncline escapes: lalr1.cc" " " 12
at_xfail=no
(
printf "%s\n" "285. $at_setup_line: testing $at_desc ..."
$at_traceon
# ICC is unable to handle these file names: it fails to pass them
# properly to the linker, and is unable to save a file named this way.
# Don't try with such compilers.
cat >\"\\\"\".cc <<'_ATEOF'
int main (void) { return 0; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS \"\\\"\".cc -o \"\\\"\" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >\"\\\"\".y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%code {
static int yylex (yy::parser::value_type *lvalp);
}
%destructor {} <>
%printer {} <>
%%
exp: '0'
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Maybe we tried to create a file name that the file system does not
# support.
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test ! -f \"\\\"\".y) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc $LIBS" "synclines.at:440"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_285
#AT_START_286
at_fn_group_banner 286 'synclines.at:440' \
"syncline escapes: glr.cc" " " 12
at_xfail=no
(
printf "%s\n" "286. $at_setup_line: testing $at_desc ..."
$at_traceon
# ICC is unable to handle these file names: it fails to pass them
# properly to the linker, and is unable to save a file named this way.
# Don't try with such compilers.
cat >\"\\\"\".cc <<'_ATEOF'
int main (void) { return 0; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS \"\\\"\".cc -o \"\\\"\" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >\"\\\"\".y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.cc"
%code {
static int yylex (yy::parser::value_type *lvalp);
}
%destructor {} <>
%printer {} <>
%%
exp: '0'
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Maybe we tried to create a file name that the file system does not
# support.
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test ! -f \"\\\"\".y) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc $LIBS" "synclines.at:440"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_286
#AT_START_287
at_fn_group_banner 287 'synclines.at:440' \
"syncline escapes: glr2.cc" " " 12
at_xfail=no
(
printf "%s\n" "287. $at_setup_line: testing $at_desc ..."
$at_traceon
# ICC is unable to handle these file names: it fails to pass them
# properly to the linker, and is unable to save a file named this way.
# Don't try with such compilers.
cat >\"\\\"\".cc <<'_ATEOF'
int main (void) { return 0; }
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CXXFLAGS \$CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77"
at_fn_check_prepare_dynamic "$CXX $CXXFLAGS $CPPFLAGS \\\"\\\\\\\"\\\".cc -o \\\"\\\\\\\"\\\" || exit 77" "synclines.at:440"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS \"\\\"\".cc -o \"\\\"\" || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >\"\\\"\".y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr2.cc"
%code {
static int yylex (yy::parser::value_type *lvalp);
}
%destructor {} <>
%printer {} <>
%%
exp: '0'
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Maybe we tried to create a file name that the file system does not
# support.
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test ! -f \"\\\"\".y) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y" "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:440"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \\\"\\\\\\\"\\\".cc \\\"\\\\\\\"\\\".y"
at_fn_check_prepare_trace "synclines.at:440"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o \"\\\"\".cc \"\\\"\".y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
printf "%s\n" "synclines.at:440" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/synclines.at:440"
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:440: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o \\\"\\\\\\\"\\\" \\\"\\\\\\\"\\\".cc $LIBS" "synclines.at:440"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o \"\\\"\" \"\\\"\".cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:440"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_287
#AT_START_288
at_fn_group_banner 288 'synclines.at:497' \
"%no-lines: yacc.c" " " 12
at_xfail=no
(
printf "%s\n" "288. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c" %header
%{
void yyerror (const char *msg);
int yylex (void);
%}
%union {
int ival;
}
%%
exp: '0'
_ATEOF
# Generate without.* without the #line. Don't use -o without.c which
# would change the content (e.g., CPP guard depend on the output file
# name).
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --no-lines -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.c without.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.c without.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.h without.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.h without.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# There is no #line at all.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep '#line' *.c *.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep '#line' *.c *.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Generate with.* without the #line.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.c with.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.c with.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.h with.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.h with.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# The implementation file with --no-line is exactly the
# original one with #lines removed.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.c >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.c >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Likewise for the header.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.h >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.h >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_288
#AT_START_289
at_fn_group_banner 289 'synclines.at:497' \
"%no-lines: glr.c" " " 12
at_xfail=no
(
printf "%s\n" "289. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.c" %header
%{
void yyerror (const char *msg);
int yylex (void);
%}
%union {
int ival;
}
%%
exp: '0'
_ATEOF
# Generate without.* without the #line. Don't use -o without.c which
# would change the content (e.g., CPP guard depend on the output file
# name).
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --no-lines -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.c without.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.c without.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.h without.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.h without.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# There is no #line at all.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep '#line' *.c *.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep '#line' *.c *.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Generate with.* without the #line.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.c with.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.c with.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.h with.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.h with.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# The implementation file with --no-line is exactly the
# original one with #lines removed.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.c >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.c >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.c"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Likewise for the header.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.h >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.h >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.h"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_289
#AT_START_290
at_fn_group_banner 290 'synclines.at:497' \
"%no-lines: lalr1.cc" " " 12
at_xfail=no
(
printf "%s\n" "290. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc" %header
%{
int yylex (yy::parser::value_type *lvalp);
%}
%union {
int ival;
}
%%
exp: '0'
_ATEOF
# Generate without.* without the #line. Don't use -o without.c which
# would change the content (e.g., CPP guard depend on the output file
# name).
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# There is no #line at all.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep '#line' *.cc *.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep '#line' *.cc *.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Generate with.* without the #line.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc with.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc with.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh with.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh with.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# The implementation file with --no-line is exactly the
# original one with #lines removed.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.cc >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.cc >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Likewise for the header.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.hh >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.hh >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_290
#AT_START_291
at_fn_group_banner 291 'synclines.at:497' \
"%no-lines: glr.cc" " " 12
at_xfail=no
(
printf "%s\n" "291. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.cc" %header
%{
int yylex (yy::parser::value_type *lvalp);
%}
%union {
int ival;
}
%%
exp: '0'
_ATEOF
# Generate without.* without the #line. Don't use -o without.c which
# would change the content (e.g., CPP guard depend on the output file
# name).
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# There is no #line at all.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep '#line' *.cc *.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep '#line' *.cc *.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Generate with.* without the #line.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc with.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc with.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh with.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh with.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# The implementation file with --no-line is exactly the
# original one with #lines removed.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.cc >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.cc >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Likewise for the header.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.hh >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.hh >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_291
#AT_START_292
at_fn_group_banner 292 'synclines.at:497' \
"%no-lines: glr2.cc" " " 12
at_xfail=no
(
printf "%s\n" "292. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr2.cc" %header
%{
int yylex (yy::parser::value_type *lvalp);
%}
%union {
int ival;
}
%%
exp: '0'
_ATEOF
# Generate without.* without the #line. Don't use -o without.c which
# would change the content (e.g., CPP guard depend on the output file
# name).
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --no-lines -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# There is no #line at all.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep '#line' *.cc *.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep '#line' *.cc *.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Generate with.* without the #line.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc -d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y" "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:497"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc -d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.cc with.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.cc with.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: mv input.hh with.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; mv input.hh with.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# The implementation file with --no-line is exactly the
# original one with #lines removed.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.cc >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.cc >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.cc"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
# Likewise for the header.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: grep -v '#line' with.hh >expout"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; grep -v '#line' with.hh >expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:497: cat without.hh"
at_fn_check_prepare_trace "synclines.at:497"
( $at_check_trace; cat without.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:497"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_292
#AT_START_293
at_fn_group_banner 293 'synclines.at:507' \
"Output columns" " " 12
at_xfail=no
(
printf "%s\n" "293. $at_setup_line: testing $at_desc ..."
$at_traceon
# This test is fragile: its point is to check the compiler's error
# message, but it seems too hard to do portability (even between
# version of GCC). So instead, let's just check the generated code
# itself.
cat >input.y <<'_ATEOF'
%{
void yyerror (const char *msg);
int yylex (void);
%}
%define api.value.type union
%type <int> '0' exp
%destructor { /* --BEGIN */
destructor
/* --END */ } <*>
%printer { /* --BEGIN */
printer
/* --END */ } <*>
%left '+'
%%
exp: exp '+' exp { /* --BEGIN */
$$ = $1 + $3;
@$ = @1 + @3;
/* --END */ }
| '0'
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "synclines.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:540"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "synclines.at:540"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "synclines.at:540"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:540: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "synclines.at:540"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:540"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/synclines.at:541: sed -ne '/--BEGIN/,/--END/{' \\
-e '/input.c/s/ [0-9]* / LINE /;' \\
-e 'p;}' \\
input.c"
at_fn_check_prepare_notrace 'an embedded newline' "synclines.at:541"
( $at_check_trace; sed -ne '/--BEGIN/,/--END/{' \
-e '/input.c/s/ [0-9]* / LINE /;' \
-e 'p;}' \
input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" " { /* --BEGIN */
printer
/* --END */ }
{ /* --BEGIN */
printer
/* --END */ }
{ /* --BEGIN */
destructor
/* --END */ }
{ /* --BEGIN */
destructor
/* --END */ }
{ /* --BEGIN */
(yyval.exp) = (yyvsp[-2].exp) + (yyvsp[0].exp);
(yyloc) = (yylsp[-2]) + (yylsp[0]);
/* --END */ }
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/synclines.at:541"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_293
#AT_START_294
at_fn_group_banner 294 'headers.at:56' \
"Invalid CPP guards: --defines=input/input.h" " " 13
at_xfail=no
(
printf "%s\n" "294. $at_setup_line: testing $at_desc ..."
$at_traceon
# Possibly create inner directories.
dirname=`$as_dirname -- input/input ||
$as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
Xinput/input : 'X\(//\)[^/]' \| \
Xinput/input : 'X\(//\)$' \| \
Xinput/input : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" Xinput/input |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p
cat >input/input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <input/input.h>
void yyerror (const char *msg);
int yylex (void);
%}
%%
dummy: %empty;
%%
#include <input/input.h>
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:56"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:56"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:56"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:56"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:56"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_trace "headers.at:56"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:56" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:56"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:56: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:56"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:56"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_294
#AT_START_295
at_fn_group_banner 295 'headers.at:57' \
"Invalid CPP guards: --defines=9foo.h" " " 13
at_xfail=no
(
printf "%s\n" "295. $at_setup_line: testing $at_desc ..."
$at_traceon
# Possibly create inner directories.
dirname=`$as_dirname -- 9foo ||
$as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X9foo : 'X\(//\)[^/]' \| \
X9foo : 'X\(//\)$' \| \
X9foo : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X9foo |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p
cat >9foo.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <9foo.h>
void yyerror (const char *msg);
int yylex (void);
%}
%%
dummy: %empty;
%%
#include <9foo.h>
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:57"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:57"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:57"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:57"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_trace "headers.at:57"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:57" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:57"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:57: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:57"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:57"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_295
#AT_START_296
at_fn_group_banner 296 'headers.at:58' \
"Invalid CPP guards: %glr-parser --defines=input/input.h" "" 13
at_xfail=no
(
printf "%s\n" "296. $at_setup_line: testing $at_desc ..."
$at_traceon
# Possibly create inner directories.
dirname=`$as_dirname -- input/input ||
$as_expr Xinput/input : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
Xinput/input : 'X\(//\)[^/]' \| \
Xinput/input : 'X\(//\)$' \| \
Xinput/input : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" Xinput/input |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p
cat >input/input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%{
#include <input/input.h>
void yyerror (const char *msg);
int yylex (void);
%}
%%
dummy: %empty;
%%
#include <input/input.h>
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:58"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y" "headers.at:58"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:58"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:58"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y"
at_fn_check_prepare_trace "headers.at:58"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=input/input.h --output=input/input.c input/input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:58" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:58"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:58: \$CC \$CFLAGS \$CPPFLAGS -c -o input/input.o -I. -c input/input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c " "headers.at:58"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input/input.o -I. -c input/input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:58"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_296
#AT_START_297
at_fn_group_banner 297 'headers.at:59' \
"Invalid CPP guards: %glr-parser --defines=9foo.h" "" 13
at_xfail=no
(
printf "%s\n" "297. $at_setup_line: testing $at_desc ..."
$at_traceon
# Possibly create inner directories.
dirname=`$as_dirname -- 9foo ||
$as_expr X9foo : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
X9foo : 'X\(//\)[^/]' \| \
X9foo : 'X\(//\)$' \| \
X9foo : 'X\(/\)' \| . 2>/dev/null ||
printf "%s\n" X9foo |
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
s//\1/
q
}
/^X\(\/\/\)[^/].*/{
s//\1/
q
}
/^X\(\/\/\)$/{
s//\1/
q
}
/^X\(\/\).*/{
s//\1/
q
}
s/.*/./; q'`
as_dir=$dirname; as_fn_mkdir_p
cat >9foo.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%{
#include <9foo.h>
void yyerror (const char *msg);
int yylex (void);
%}
%%
dummy: %empty;
%%
#include <9foo.h>
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y" "headers.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:59"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:59"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y"
at_fn_check_prepare_trace "headers.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --defines=9foo.h --output=9foo.c 9foo.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:59" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:59"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:59: \$CC \$CFLAGS \$CPPFLAGS -c -o 9foo.o -I. -c 9foo.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c " "headers.at:59"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o 9foo.o -I. -c 9foo.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_297
#AT_START_298
at_fn_group_banner 298 'headers.at:67' \
"export YYLTYPE" " " 13
at_xfail=no
(
printf "%s\n" "298. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%name-prefix "my_"
%{
#include <stdio.h>
#include <stdlib.h>
/* A C error reporting function. */
/* !POSIX */ static
void my_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int my_lex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
%}
%%
exp: %empty;
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --header -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header -o input.c input.y" "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:85"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:85"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:85"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header -o input.c input.y"
at_fn_check_prepare_trace "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --header -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:11.1-18: warning: deprecated directive: '%name-prefix \"my_\"', use '%define api.prefix {my_}' [-Wdeprecated]
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Werror" "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:11.1-18: warning: deprecated directive: '%name-prefix "my_"', use '%define api.prefix {my_}' [-Wdeprecated]
input.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "headers.at:85"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=error" "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Wnone,none -Werror --trace=none" "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:85: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=none -Werror --trace=none" "headers.at:85"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --header -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:85"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
# YYLTYPE should be defined, and MY_LLOC declared.
cat >caller.c <<'_ATEOF'
#include "input.h"
YYLTYPE *my_llocp = &my_lloc;
int my_parse (void);
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return my_parse ();
}
_ATEOF
# Link and execute, just to make sure everything is fine (and in
# particular, that MY_LLOC is indeed defined somewhere).
printf "%s\n" "headers.at:102" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:102"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:102: \$CC \$CFLAGS \$CPPFLAGS -c -o caller.o caller.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c " "headers.at:102"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o caller.o caller.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:102"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:103" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:103"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:103: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:103"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:103"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:104" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:104"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:104: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o caller caller.o input.o \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS" "headers.at:104"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o caller caller.o input.o $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:104"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:105: \$PREPARSER ./caller"
at_fn_check_prepare_dynamic " $PREPARSER ./caller" "headers.at:105"
( $at_check_trace; $PREPARSER ./caller
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:105"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:105: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:105"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:105"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_298
#AT_START_299
at_fn_group_banner 299 'headers.at:177' \
"Sane headers: " " " 13
at_xfail=no
(
printf "%s\n" "299. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:177"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:177"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:177"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:177"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:177"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:177"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:177" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:177"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:177"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:177" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:177"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:177: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:177"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:177"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_299
#AT_START_300
at_fn_group_banner 300 'headers.at:178' \
"Sane headers: %locations %debug" " " 13
at_xfail=no
(
printf "%s\n" "300. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations %debug
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp:
X { printf ("x\n"); }
;
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(yylloc).first_line = (yylloc).last_line = 1;
(yylloc).first_column = (yylloc).last_column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:178"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:178"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:178"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:178"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:178"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:178"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:178" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:178"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:178"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:178" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:178"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:178: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:178"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:178"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_300
#AT_START_301
at_fn_group_banner 301 'headers.at:180' \
"Sane headers: %glr-parser" " " 13
at_xfail=no
(
printf "%s\n" "301. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%glr-parser
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:180"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:180"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:180"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:180"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:180"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:180"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:180" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:180"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:180"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:180" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:180"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:180: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:180"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:180"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_301
#AT_START_302
at_fn_group_banner 302 'headers.at:181' \
"Sane headers: %locations %debug %glr-parser" " " 13
at_xfail=no
(
printf "%s\n" "302. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations %debug %glr-parser
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp:
X { printf ("x\n"); }
;
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(yylloc).first_line = (yylloc).last_line = 1;
(yylloc).first_column = (yylloc).last_column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:181"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:181"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:181"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:181"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:181"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:181"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:181" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:181"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:181"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:181" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:181"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:181: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:181"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:181"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_302
#AT_START_303
at_fn_group_banner 303 'headers.at:183' \
"Sane headers: api.pure" " " 13
at_xfail=no
(
printf "%s\n" "303. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.pure
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:183"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:183"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:183"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:183"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:183"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:183"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:183" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:183"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:183"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:183" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:183"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:183: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:183"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:183"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_303
#AT_START_304
at_fn_group_banner 304 'headers.at:184' \
"Sane headers: api.push-pull=both" " " 13
at_xfail=no
(
printf "%s\n" "304. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.push-pull both
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:184"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:184"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:184"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:184"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:184" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:184"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:184"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:184" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:184"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:184: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:184"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:184"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_304
#AT_START_305
at_fn_group_banner 305 'headers.at:185' \
"Sane headers: api.pure api.push-pull=both" " " 13
at_xfail=no
(
printf "%s\n" "305. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.pure %define api.push-pull both
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static int const input[] = {X, 0};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:185"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y" "headers.at:185"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:185"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:185"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:185"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y"
at_fn_check_prepare_trace "headers.at:185"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:185" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:185"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: \$CC \$CFLAGS \$CPPFLAGS -c -o input.o input.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o input.o input.c " "headers.at:185"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o input.o input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.h
do
# No shell expansion with AT_DATA.
cat >$h.c <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:185" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:185"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:185: \$CC \$CFLAGS \$CPPFLAGS -c -o \$h.o \$h.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c " "headers.at:185"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o $h.o $h.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:185"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_305
#AT_START_306
at_fn_group_banner 306 'headers.at:187' \
"Sane headers: c++" " " 13
at_xfail=no
(
printf "%s\n" "306. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%language "c++"
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
static int yylex (yy::parser::value_type *lvalp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = {yy::parser::token::X, 0};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:187"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:187"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:187"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:187"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:187"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y"
at_fn_check_prepare_trace "headers.at:187"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:187" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:187"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o input.o input.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc " "headers.at:187"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.hh
do
# No shell expansion with AT_DATA.
cat >$h.cc <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:187" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:187"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:187: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o \$h.o \$h.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc " "headers.at:187"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:187"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_306
#AT_START_307
at_fn_group_banner 307 'headers.at:188' \
"Sane headers: %locations %debug c++" " " 13
at_xfail=no
(
printf "%s\n" "307. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations %debug %language "c++"
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int const input[] = {yy::parser::token::X, 0};
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:188"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:188"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:188"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:188"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:188"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y"
at_fn_check_prepare_trace "headers.at:188"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:188" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:188"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o input.o input.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc " "headers.at:188"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.hh
do
# No shell expansion with AT_DATA.
cat >$h.cc <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:188" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:188"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:188: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o \$h.o \$h.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc " "headers.at:188"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:188"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_307
#AT_START_308
at_fn_group_banner 308 'headers.at:189' \
"Sane headers: c++ api.value.type=variant parse.assert" "" 13
at_xfail=no
(
printf "%s\n" "308. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%language "c++" %define api.value.type variant %define parse.assert
%define parse.error verbose
%token <int> X
%code {
#include <stdio.h> /* printf. */
static int yylex (yy::parser::value_type *lvalp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = {yy::parser::token::X, 0};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:189"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:189"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:189"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:189"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:189"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y"
at_fn_check_prepare_trace "headers.at:189"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:189" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:189"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o input.o input.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc " "headers.at:189"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.hh
do
# No shell expansion with AT_DATA.
cat >$h.cc <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:189" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:189"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:189: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o \$h.o \$h.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc " "headers.at:189"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:189"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_308
#AT_START_309
at_fn_group_banner 309 'headers.at:191' \
"Sane headers: %locations c++ %glr-parser" " " 13
at_xfail=no
(
printf "%s\n" "309. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations %language "c++" %glr-parser
%define parse.error verbose
%union {int integer;}
%token <integer> X
%code {
#include <stdio.h> /* printf. */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp:
X { printf ("x\n"); }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int const input[] = {yy::parser::token::X, 0};
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y" "headers.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:191"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:191"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:191"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y"
at_fn_check_prepare_trace "headers.at:191"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:191" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:191"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o input.o input.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc " "headers.at:191"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o input.o input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
(void) argc;
(void) argv;
return p.parse ();
}
_ATEOF
# Check that the headers are self-contained, and protected against
# multiple inclusions. While at it, check they are sane for C++.
for h in *.hh
do
# No shell expansion with AT_DATA.
cat >$h.cc <<EOF
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "$h"
#include "$h"
EOF
printf "%s\n" "headers.at:191" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:191"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:191: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o \$h.o \$h.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc " "headers.at:191"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o $h.o $h.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:191"
$at_failed && at_fn_log_failure
$at_traceon; }
done
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_309
#AT_START_310
at_fn_group_banner 310 'headers.at:199' \
"Several parsers" " " 13
at_xfail=no
(
printf "%s\n" "310. $at_setup_line: testing $at_desc ..."
$at_traceon
# AT_TEST([PREFIX], [DIRECTIVES])
# -------------------------------
# Generate and compile to *.o. Make sure there is no (allowed) YY*
# nor yy* identifiers in the header after applying api.prefix. Check
# that headers can be compiled by a C++ compiler.
#
# They should all use parse.assert to make sure that we don't even
# conflict of YY_ASSERT.
# AT_TEST
cat >main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
// If we are compiling with CC=$CXX, then do not load the C headers
// inside extern "C", since they were _not_ compiled this way.
#if ! CC_IS_CXX
extern "C"
{
#endif
#include "x1.h"
#include "x2.h"
#include "x3.h"
#include "x4.h"
#include "x6.h"
#include "x7.h"
#include "x8.h"
#if ! CC_IS_CXX
}
#endif
#include "x5.hh"
#include "x9.hh"
#include "xa.hh"
#include "xb.hh"
#include "xc.hh"
#include "xd.hh"
#define RUN(S) \
do { \
int res = S; \
if (res) \
std::cerr << #S": " << res << '\n'; \
} while (false)
int
main (void)
{
RUN(x1_parse());
RUN(x2_parse());
RUN(x3_parse());
RUN(x4_parse());
x5_::parser p5;
RUN(p5.parse());
RUN(x6_parse());
RUN(x7_parse());
RUN(x8_parse());
x9_::parser p9;
RUN(p9.parse());
xa_::parser pa;
RUN(pa.parse());
xb_::parser pb;
RUN(pb.parse());
xc_::parser pc;
RUN(pc.parse());
xd_::parser pd;
RUN(pd.parse());
return 0;
}
_ATEOF
# main.cc
cat >x1.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x1_}
%define parse.assert
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void x1_error (const char *msg);
static int x1_lex (void);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void x1_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x1_lex (void)
{
static char const input[] = "x1";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x1.c x1.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:320"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x1.c x1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y" "headers.at:320"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x1.c x1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:320"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:320"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:320"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x1.c x1.y"
at_fn_check_prepare_trace "headers.at:320"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x1.c x1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:320" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:320"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: \$CC \$CFLAGS \$CPPFLAGS -c -o x1.o x1.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c " "headers.at:320"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x1.o x1.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:320: echo \"x1\" >>expout"
at_fn_check_prepare_trace "headers.at:320"
( $at_check_trace; echo "x1" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:320"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x2.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x2_}
%define parse.assert
%locations %debug
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
#if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, X2_LTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void x2_error (const char *msg);
static int x2_lex (void);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
# if defined X2_LTYPE_IS_TRIVIAL && X2_LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, X2_LTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void x2_error (const char *msg)
{
LOCATION_PRINT (stderr, (x2_lloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x2_lex (void)
{
static char const input[] = "x2";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(x2_lloc).first_line = (x2_lloc).last_line = 1;
(x2_lloc).first_column = (x2_lloc).last_column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x2.c x2.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:321"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x2.c x2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y" "headers.at:321"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x2.c x2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:321"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:321"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:321"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x2.c x2.y"
at_fn_check_prepare_trace "headers.at:321"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x2.c x2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:321" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:321"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: \$CC \$CFLAGS \$CPPFLAGS -c -o x2.o x2.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c " "headers.at:321"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x2.o x2.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:321: echo \"x2\" >>expout"
at_fn_check_prepare_trace "headers.at:321"
( $at_check_trace; echo "x2" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:321"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x3.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x3_}
%define parse.assert
%glr-parser
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void x3_error (const char *msg);
static int x3_lex (void);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void x3_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x3_lex (void)
{
static char const input[] = "x3";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x3.c x3.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x3.c x3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y" "headers.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x3.c x3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:322"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:322"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:322"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x3.c x3.y"
at_fn_check_prepare_trace "headers.at:322"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x3.c x3.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:322" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:322"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: \$CC \$CFLAGS \$CPPFLAGS -c -o x3.o x3.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c " "headers.at:322"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x3.o x3.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:322: echo \"x3\" >>expout"
at_fn_check_prepare_trace "headers.at:322"
( $at_check_trace; echo "x3" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:322"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x4.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x4_}
%define parse.assert
%locations %debug %glr-parser
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
#if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, X4_LTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void x4_error (const char *msg);
static int x4_lex (void);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
# if defined X4_LTYPE_IS_TRIVIAL && X4_LTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, X4_LTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void x4_error (const char *msg)
{
LOCATION_PRINT (stderr, (x4_lloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x4_lex (void)
{
static char const input[] = "x4";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(x4_lloc).first_line = (x4_lloc).last_line = 1;
(x4_lloc).first_column = (x4_lloc).last_column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x4.c x4.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:323"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x4.c x4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y" "headers.at:323"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x4.c x4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:323"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:323"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:323"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x4.c x4.y"
at_fn_check_prepare_trace "headers.at:323"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x4.c x4.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:323" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:323"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: \$CC \$CFLAGS \$CPPFLAGS -c -o x4.o x4.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c " "headers.at:323"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x4.o x4.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:323: echo \"x4\" >>expout"
at_fn_check_prepare_trace "headers.at:323"
( $at_check_trace; echo "x4" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:323"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x5.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x5_}
%define parse.assert
%locations %debug %language "c++"
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
static int x5_lex (x5_::parser::value_type *lvalp, x5_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
x5_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int x5_lex (x5_::parser::value_type *lvalp, x5_::parser::location_type *llocp)
{
static char const input[] = "x5";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x5.cc x5.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:324"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x5.cc x5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y" "headers.at:324"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x5.cc x5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:324"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:324"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:324"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x5.cc x5.y"
at_fn_check_prepare_trace "headers.at:324"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x5.cc x5.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:324" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:324"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o x5.o x5.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o x5.o x5.cc " "headers.at:324"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o x5.o x5.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:324: echo \"x5\" >>expout"
at_fn_check_prepare_trace "headers.at:324"
( $at_check_trace; echo "x5" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:324"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x6.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x6_}
%define parse.assert
%define api.pure
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#include <stdio.h>
/* !POSIX */ static void x6_error (const char *msg);
static int x6_lex (X6_STYPE *lvalp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void x6_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x6_lex (X6_STYPE *lvalp)
{
static char const input[] = "x6";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x6.c x6.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x6.c x6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y" "headers.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x6.c x6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:325"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:325"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:325"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x6.c x6.y"
at_fn_check_prepare_trace "headers.at:325"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x6.c x6.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:325" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:325"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: \$CC \$CFLAGS \$CPPFLAGS -c -o x6.o x6.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c " "headers.at:325"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x6.o x6.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:325: echo \"x6\" >>expout"
at_fn_check_prepare_trace "headers.at:325"
( $at_check_trace; echo "x6" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:325"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x7.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x7_}
%define parse.assert
%define api.push-pull both
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <stdio.h>
/* !POSIX */ static void x7_error (const char *msg);
static int x7_lex (void);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void x7_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x7_lex (void)
{
static char const input[] = "x7";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x7.c x7.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x7.c x7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y" "headers.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x7.c x7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x7.c x7.y"
at_fn_check_prepare_trace "headers.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x7.c x7.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:326" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:326"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: \$CC \$CFLAGS \$CPPFLAGS -c -o x7.o x7.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c " "headers.at:326"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x7.o x7.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:326: echo \"x7\" >>expout"
at_fn_check_prepare_trace "headers.at:326"
( $at_check_trace; echo "x7" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x8.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x8_}
%define parse.assert
%define api.pure %define api.push-pull both
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
#if defined __GNUC__ && (7 == __GNUC__ || 9 == __GNUC__)
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
#include <stdio.h>
/* !POSIX */ static void x8_error (const char *msg);
static int x8_lex (X8_STYPE *lvalp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void x8_error (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int x8_lex (X8_STYPE *lvalp)
{
static char const input[] = "x8";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x8.c x8.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x8.c x8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y" "headers.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x8.c x8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:327"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:327"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:327"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x8.c x8.y"
at_fn_check_prepare_trace "headers.at:327"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x8.c x8.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:327" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:327"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: \$CC \$CFLAGS \$CPPFLAGS -c -o x8.o x8.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c " "headers.at:327"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o x8.o x8.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:327: echo \"x8\" >>expout"
at_fn_check_prepare_trace "headers.at:327"
( $at_check_trace; echo "x8" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:327"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >x9.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {x9_}
%define parse.assert
%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %debug %language "c++"
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
static int x9_lex (x9_::parser::value_type *lvalp, x9_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
x9_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int x9_lex (x9_::parser::value_type *lvalp, x9_::parser::location_type *llocp)
{
static char const input[] = "x9";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o x9.cc x9.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o x9.cc x9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y" "headers.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o x9.cc x9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:328"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:328"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x9.cc x9.y"
at_fn_check_prepare_trace "headers.at:328"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o x9.cc x9.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:328" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:328"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o x9.o x9.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o x9.o x9.cc " "headers.at:328"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o x9.o x9.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:328: echo \"x9\" >>expout"
at_fn_check_prepare_trace "headers.at:328"
( $at_check_trace; echo "x9" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:328"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >xa.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {xa_}
%define parse.assert
%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %language "c++" %define api.value.type variant
%define parse.error verbose
%code {
#include <stdio.h> /* printf. */
static int xa_lex (xa_::parser::value_type *lvalp, xa_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
xa_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int xa_lex (xa_::parser::value_type *lvalp, xa_::parser::location_type *llocp)
{
static char const input[] = "xa";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o xa.cc xa.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:329"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o xa.cc xa.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xa.cc xa.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xa.cc xa.y" "headers.at:329"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xa.cc xa.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:329"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:329"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:329"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xa.cc xa.y"
at_fn_check_prepare_trace "headers.at:329"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xa.cc xa.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:329" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:329"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o xa.o xa.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o xa.o xa.cc " "headers.at:329"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o xa.o xa.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:329: echo \"xa\" >>expout"
at_fn_check_prepare_trace "headers.at:329"
( $at_check_trace; echo "xa" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:329"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >xb.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {xb_}
%define parse.assert
%locations %define api.location.file none %language "c++" %define api.value.type variant
%define parse.error verbose
%code {
#include <stdio.h> /* printf. */
static int xb_lex (xb_::parser::value_type *lvalp, xb_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
xb_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int xb_lex (xb_::parser::value_type *lvalp, xb_::parser::location_type *llocp)
{
static char const input[] = "xb";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o xb.cc xb.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o xb.cc xb.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xb.cc xb.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xb.cc xb.y" "headers.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xb.cc xb.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:330"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:330"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:330"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xb.cc xb.y"
at_fn_check_prepare_trace "headers.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xb.cc xb.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:330" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:330"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o xb.o xb.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o xb.o xb.cc " "headers.at:330"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o xb.o xb.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:330: echo \"xb\" >>expout"
at_fn_check_prepare_trace "headers.at:330"
( $at_check_trace; echo "xb" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >xc.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {xc_}
%define parse.assert
%locations %code requires {#include "location.hh"} %define api.location.type {::x5_::location} %skeleton "glr2.cc"
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
static int xc_lex (xc_::parser::value_type *lvalp, xc_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
xc_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int xc_lex (xc_::parser::value_type *lvalp, xc_::parser::location_type *llocp)
{
static char const input[] = "xc";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o xc.cc xc.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:331"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o xc.cc xc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xc.cc xc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xc.cc xc.y" "headers.at:331"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xc.cc xc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:331"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:331"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:331"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xc.cc xc.y"
at_fn_check_prepare_trace "headers.at:331"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xc.cc xc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:331" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:331"
printf "%s\n" "headers.at:331" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:331"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS -c -o xc.o xc.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS -c -o xc.o xc.cc " "headers.at:331"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS -c -o xc.o xc.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:331: echo \"xc\" >>expout"
at_fn_check_prepare_trace "headers.at:331"
( $at_check_trace; echo "xc" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:331"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >xd.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define api.prefix {xd_}
%define parse.assert
%locations %define api.location.file none %skeleton "glr2.cc"
%define parse.error verbose
%union {int integer;}
%code {
#include <stdio.h> /* printf. */
static int xd_lex (xd_::parser::value_type *lvalp, xd_::parser::location_type *llocp);
}
%%
exp:
'x' '1' { printf ("x1\n"); }
| 'x' '2' { printf ("x2\n"); }
| 'x' '3' { printf ("x3\n"); }
| 'x' '4' { printf ("x4\n"); }
| 'x' '5' { printf ("x5\n"); }
| 'x' '6' { printf ("x6\n"); }
| 'x' '7' { printf ("x7\n"); }
| 'x' '8' { printf ("x8\n"); }
| 'x' '9' { printf ("x9\n"); }
| 'x' 'a' { printf ("xa\n"); }
| 'x' 'b' { printf ("xb\n"); }
| 'x' 'c' { printf ("xc\n"); }
| 'x' 'd' { printf ("xd\n"); }
;
%%
/* A C++ error reporting function. */
void
xd_::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int xd_lex (xd_::parser::value_type *lvalp, xd_::parser::location_type *llocp)
{
static char const input[] = "xd";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -o xd.cc xd.y"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:332"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -o xd.cc xd.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xd.cc xd.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xd.cc xd.y" "headers.at:332"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -o xd.cc xd.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:332"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "headers.at:332"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "headers.at:332"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xd.cc xd.y"
at_fn_check_prepare_trace "headers.at:332"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -o xd.cc xd.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:332" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:332"
printf "%s\n" "headers.at:332" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:332"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS -c -o xd.o xd.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS -c -o xd.o xd.cc " "headers.at:332"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS -c -o xd.o xd.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:332: echo \"xd\" >>expout"
at_fn_check_prepare_trace "headers.at:332"
( $at_check_trace; echo "xd" >>expout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:332"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that api.prefix works properly:
#
# - no 'yy' left.
# C++ output relies on namespaces and still uses yy a lot.
#
# - no 'YY' left.
# Ignore YYPUSH_MORE(_DEFINED)? (constant definition),
# YYDEBUG (not renamed) can be read, but not changed.
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/headers.at:342: \"\$PERL\" -n -0777 -e '
# Ignore comments.
s{/\\*.*?\\*/}{}gs;
s{//.*}{}g;
# Ignore warnings.
s{# *pragma .* message \".*\"}{}g;
s{\\b((defined|if)\\ YYDEBUG
|YYChar # Template parameter.
|YYNTOKENS # This is actually scoped in a C++ class.
|YYPUSH_MORE(?:_DEFINED)?
|S_(YY(ACCEPT|EMPTY|EOF|error|UNDEF)) # These guys are scoped.
|YY(?:_REINTERPRET)?_CAST
|YY_ATTRIBUTE(?:_PURE|_UNUSED)
|YY_CONSTEXPR
|YY_COPY
|YY_CPLUSPLUS
|YY_IGNORE_(?:MAYBE_UNINITIALIZED|USELESS_CAST)_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_MOVE
|YY_MOVE_OR_COPY
|YY_MOVE_REF
|YY_NOEXCEPT
|YY_NOTHROW
|YY_NULLPTR
|YY_RVREF
|YY_USE
|YY_\\w+_INCLUDED # Header guards.
|FILE\\ \\*yyo # Function argument.
|const\\ yylocp # Function argument.
)\\b}{}gx;
while (/^(.*YY.*)\$/gm)
{
print \"\$ARGV: invalid exported YY: \$1\\n\";
}
if (\$ARGV =~ /\\.h\$/)
{
while (/^(.*yy.*)\$/gm)
{
print \"\$ARGV: invalid exported yy: \$1\\n\";
}
}
' -- *.hh *.h"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:342"
( $at_check_trace; "$PERL" -n -0777 -e '
# Ignore comments.
s{/\*.*?\*/}{}gs;
s{//.*}{}g;
# Ignore warnings.
s{# *pragma .* message ".*"}{}g;
s{\b((defined|if)\ YYDEBUG
|YYChar # Template parameter.
|YYNTOKENS # This is actually scoped in a C++ class.
|YYPUSH_MORE(?:_DEFINED)?
|S_(YY(ACCEPT|EMPTY|EOF|error|UNDEF)) # These guys are scoped.
|YY(?:_REINTERPRET)?_CAST
|YY_ATTRIBUTE(?:_PURE|_UNUSED)
|YY_CONSTEXPR
|YY_COPY
|YY_CPLUSPLUS
|YY_IGNORE_(?:MAYBE_UNINITIALIZED|USELESS_CAST)_(?:BEGIN|END)
|YY_INITIAL_VALUE
|YY_MOVE
|YY_MOVE_OR_COPY
|YY_MOVE_REF
|YY_NOEXCEPT
|YY_NOTHROW
|YY_NULLPTR
|YY_RVREF
|YY_USE
|YY_\w+_INCLUDED # Header guards.
|FILE\ \*yyo # Function argument.
|const\ yylocp # Function argument.
)\b}{}gx;
while (/^(.*YY.*)$/gm)
{
print "$ARGV: invalid exported YY: $1\n";
}
if ($ARGV =~ /\.h$/)
{
while (/^(.*yy.*)$/gm)
{
print "$ARGV: invalid exported yy: $1\n";
}
}
' -- *.hh *.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:342"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Do this late, so that other checks have been performed.
cat >c-and-cxx.h <<'_ATEOF'
#ifdef __cplusplus
extern "C"
{
#endif
int fortytwo (void);
#ifdef __cplusplus
}
#endif
_ATEOF
cat >c-only.c <<'_ATEOF'
#include "c-and-cxx.h"
int
main (void)
{
return fortytwo () == 42 ? 0 : 1;
}
_ATEOF
cat >cxx-only.cc <<'_ATEOF'
#include "c-and-cxx.h"
int fortytwo ()
{
return 42;
}
_ATEOF
printf "%s\n" "headers.at:387" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:387"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:387: \$CC \$CFLAGS \$CPPFLAGS -c -o c-only.o c-only.c "
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c " "headers.at:387"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS -c -o c-only.o c-only.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:387"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "headers.at:387" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:387"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:387: \$CXX \$CPPFLAGS \$CXXFLAGS -c -o cxx-only.o cxx-only.cc "
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS -c -o cxx-only.o cxx-only.cc " "headers.at:387"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS -c -o cxx-only.o cxx-only.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:387: \$CXX \$CXXFLAGS \$CPPFLAGS \$LDFLAGS c-only.o cxx-only.o -o c-and-cxx ||
exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "headers.at:387"
( $at_check_trace; $CXX $CXXFLAGS $CPPFLAGS $LDFLAGS c-only.o cxx-only.o -o c-and-cxx ||
exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:387: \$PREPARSER ./c-and-cxx"
at_fn_check_prepare_dynamic " $PREPARSER ./c-and-cxx" "headers.at:387"
( $at_check_trace; $PREPARSER ./c-and-cxx
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:387"
$at_failed && at_fn_log_failure
$at_traceon; }
# The header generated by glr2.cc requires C++11. Push the options to
# prepare AT_COMPILE_CXX.
printf "%s\n" "headers.at:392" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:392"
printf "%s\n" "headers.at:392" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/headers.at:392"
{ set +x
printf "%s\n" "$at_srcdir/headers.at:392: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o parser x[1-9a-d].o -DCC_IS_CXX=\$CC_IS_CXX main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o parser x[1-9a-d].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS" "headers.at:392"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o parser x[1-9a-d].o -DCC_IS_CXX=$CC_IS_CXX main.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:394: \$PREPARSER ./parser"
at_fn_check_prepare_dynamic " $PREPARSER ./parser" "headers.at:394"
( $at_check_trace; $PREPARSER ./parser
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/headers.at:394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "headers.at:394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/headers.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_310
#AT_START_311
at_fn_group_banner 311 'actions.at:24' \
"Midrule actions" " " 14
at_xfail=no
(
printf "%s\n" "311. $at_setup_line: testing $at_desc ..."
$at_traceon
# Bison once forgot the midrule actions. It was because the action
# was attached to the host rule (the one with the midrule action),
# instead of being attached to the empty rule dedicated to this
# action.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: { putchar ('0'); }
'1' { putchar ('1'); }
'2' { putchar ('2'); }
'3' { putchar ('3'); }
'4' { putchar ('4'); }
'5' { putchar ('5'); }
'6' { putchar ('6'); }
'7' { putchar ('7'); }
'8' { putchar ('8'); }
'9' { putchar ('9'); }
{ putchar ('\n'); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "123456789";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:59"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:59"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:59"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:59: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:59"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:59"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:60" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:60"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:60: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:60"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:60"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:61: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:61"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0123456789
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:61: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:61"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:61"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_311
#AT_START_312
at_fn_group_banner 312 'actions.at:72' \
"Typed midrule actions" " " 14
at_xfail=no
(
printf "%s\n" "312. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%union {
int ival;
}
%type <ival> exp
%%
exp: <ival>{ $$ = 0; }
'1' <ival>{ $$ = 1; }
'2' <ival>{ $$ = 2; }
'3' <ival>{ $$ = 3; }
'4' <ival>{ $$ = 4; }
'5' <ival>{ $$ = 5; }
'6' <ival>{ $$ = 6; }
'7' <ival>{ $$ = 7; }
'8' <ival>{ $$ = 8; }
'9' <ival>{ $$ = 9; } <ival>{ $$ = 10; } <ival>{ $$ = 11; }
{
$$ = $1 + $3 + $5 + $7 + $9 + $11 + $13 + $15 + $17 + $19 + $20 + $21;
printf ("%d\n", $$);
}
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "123456789";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:109"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:109"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:109"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:109"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:109"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:109: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:109"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:109"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:110" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:110"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:110: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:110"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:110"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:111: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:111"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "66
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:111: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:111"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:111"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_312
#AT_START_313
at_fn_group_banner 313 'actions.at:122' \
"Implicitly empty rule" " " 14
at_xfail=no
(
printf "%s\n" "313. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >1.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: a b;
a: /* empty. */ {};
// A midrule action does not count as an empty rule.
b: {} {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wempty-rule 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y" "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wempty-rule 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:133"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:133"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y"
at_fn_check_prepare_trace "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
11 | a: /* empty. */ {};
| ^~
| %empty
1.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror" "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
1.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
11 | a: /* empty. */ {};
| ^~
| %empty
1.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:133"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error" "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none" "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:133: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none" "actions.at:133"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -Wempty-rule 1.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:133"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
cat >2.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp: a b c;
a: /* empty. */ {};
b: %empty {};
c: /* empty. */ {};
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y" "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:149"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:149"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:149"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret 2.y"
at_fn_check_prepare_trace "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
11 | a: /* empty. */ {};
| ^~
| %empty
2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule]
13 | c: /* empty. */ {};
| ^~
| %empty
2.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror" "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
2.y:11.17-18: warning: empty rule without %empty [-Wempty-rule]
11 | a: /* empty. */ {};
| ^~
| %empty
2.y:13.17-18: warning: empty rule without %empty [-Wempty-rule]
13 | c: /* empty. */ {};
| ^~
| %empty
2.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:149"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error" "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none" "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:149: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none" "actions.at:149"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret 2.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:149"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:161"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -Wno-empty-rule 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y" "actions.at:161"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -Wno-empty-rule 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:161"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:161"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:161: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wno-empty-rule 2.y"
at_fn_check_prepare_trace "actions.at:161"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -Wno-empty-rule 2.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:161"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_313
#AT_START_314
at_fn_group_banner 314 'actions.at:172' \
"Invalid uses of %empty" " " 14
at_xfail=no
(
printf "%s\n" "314. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >one.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp:
%empty {} %empty
;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/actions.at:182: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y" "actions.at:182"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret one.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "one.y:11.13-18: error: only one %empty allowed per rule
11 | %empty {} %empty
| ^~~~~~
one.y:11.3-8: note: previous declaration
11 | %empty {} %empty
| ^~~~~~
one.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:182"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:192: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y" "actions.at:192"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -u one.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "one.y:11.13-18: error: only one %empty allowed per rule
11 | %empty {} %empty
| ^~~~~~
one.y:11.3-8: note: previous declaration
11 | %empty {} %empty
| ^~~~~~
bison: file 'one.y' was updated (backup: 'one.y~')
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:192"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:202: sed -e '1,8d' one.y"
at_fn_check_prepare_trace "actions.at:202"
( $at_check_trace; sed -e '1,8d' one.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "%%
exp:
%empty {}
;
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:202"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >two.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%%
exp:
'a' %empty {}
| %empty 'a' {}
| %empty {} {}
;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/actions.at:219: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y" "actions.at:219"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret two.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "two.y:11.7-12: error: %empty on non-empty rule
11 | 'a' %empty {}
| ^~~~~~
two.y:12.3-8: error: %empty on non-empty rule
12 | | %empty 'a' {}
| ^~~~~~
two.y:13.3-8: error: %empty on non-empty rule
13 | | %empty {} {}
| ^~~~~~
two.y: warning: fix-its can be applied. Rerun with option '--update'. [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:219"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_314
#AT_START_315
at_fn_group_banner 315 'actions.at:240' \
"Valid uses of %empty" " " 14
at_xfail=no
(
printf "%s\n" "315. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: %empty {}
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:259"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:259"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:259"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:259"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:259"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:259"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:259" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:259"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:259: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:259"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:259"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:260: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:260"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:260"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:260: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:260"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:260"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_315
#AT_START_316
at_fn_group_banner 316 'actions.at:270' \
"Add missing %empty" " " 14
at_xfail=no
(
printf "%s\n" "316. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%%
exp: a b c d e
a: {}
b:{
};
c:
d
:
e:
%%
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv --update -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:285"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv --update -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -Wall input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -Wall input.y" "actions.at:285"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml --update -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:285"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:285"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:285"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:285: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --update -Wall input.y"
at_fn_check_prepare_trace "actions.at:285"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret --update -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:285"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:286: cat input.y"
at_fn_check_prepare_trace "actions.at:286"
( $at_check_trace; cat input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "%%
exp: a b c d e
a: %empty {}
b: %empty {
};
c: %empty
d
: %empty
e: %empty
%%
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:286"
$at_failed && at_fn_log_failure
$at_traceon; }
# No warnings.
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wall input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:300"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y" "actions.at:300"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:300"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:300"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:300"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:300: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y"
at_fn_check_prepare_trace "actions.at:300"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wall input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:300"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_316
#AT_START_317
at_fn_group_banner 317 'actions.at:365' \
"Initial location: yacc.c " " " 14
at_xfail=no
(
printf "%s\n" "317. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (void)
{
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:365"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:365"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:365"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:365"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:365"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:365"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:365" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:365"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:365"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:365"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:365: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:365"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:365"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_317
#AT_START_318
at_fn_group_banner 318 'actions.at:366' \
"Initial location: yacc.c api.pure=full" " " 14
at_xfail=no
(
printf "%s\n" "318. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.pure full
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:366"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:366"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:366"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:366"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:366"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:366"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:366" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:366"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:366"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:366"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:366: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:366"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:366"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_318
#AT_START_319
at_fn_group_banner 319 'actions.at:367' \
"Initial location: yacc.c api.pure %parse-param { int x }" "" 14
at_xfail=no
(
printf "%s\n" "319. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.pure %parse-param { int x }
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, int x, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, int x, const char *msg)
{
YY_USE (x);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse (0);
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:367"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:367"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:367"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:367" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:367"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:367"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:367"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:367"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_319
#AT_START_320
at_fn_group_banner 320 'actions.at:368' \
"Initial location: yacc.c api.push-pull=both" " " 14
at_xfail=no
(
printf "%s\n" "320. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.push-pull both
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (void)
{
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:368"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:368" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:368"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:368"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:368"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:368"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_320
#AT_START_321
at_fn_group_banner 321 'actions.at:369' \
"Initial location: yacc.c api.push-pull=both api.pure=full" "" 14
at_xfail=no
(
printf "%s\n" "321. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.push-pull both %define api.pure full
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:369"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:369" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:369"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:369"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:369"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:369"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_321
#AT_START_322
at_fn_group_banner 322 'actions.at:370' \
"Initial location: glr.c " " " 14
at_xfail=no
(
printf "%s\n" "322. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr.c"
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (void)
{
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:370"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:370" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:370"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:370"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:370"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:370"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_322
#AT_START_323
at_fn_group_banner 323 'actions.at:371' \
"Initial location: glr.c api.pure" " " 14
at_xfail=no
(
printf "%s\n" "323. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr.c"
%define api.pure
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:371"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:371"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:371"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:371" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:371"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:371"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:371"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:371"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_323
#AT_START_324
at_fn_group_banner 324 'actions.at:372' \
"Initial location: lalr1.cc " " " 14
at_xfail=no
(
printf "%s\n" "324. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "lalr1.cc"
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: { std::cerr << @$ << '\n'; }
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yy::parser p;
p.set_debug_level (!!getenv ("YYDEBUG"));
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:372"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:372"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:372"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:372" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:372"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:372"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:372"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:372: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:372"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:372"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_324
#AT_START_325
at_fn_group_banner 325 'actions.at:373' \
"Initial location: glr.cc " " " 14
at_xfail=no
(
printf "%s\n" "325. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr.cc"
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: { std::cerr << @$ << '\n'; }
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yy::parser p;
p.set_debug_level (!!getenv ("YYDEBUG"));
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:373"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:373"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:373"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:373"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:373"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:373"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:373" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:373"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:373"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:373"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:373: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:373"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:373"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_325
#AT_START_326
at_fn_group_banner 326 'actions.at:374' \
"Initial location: glr2.cc " " " 14
at_xfail=no
(
printf "%s\n" "326. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr2.cc"
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: { std::cerr << @$ << '\n'; }
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yy::parser p;
p.set_debug_level (!!getenv ("YYDEBUG"));
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:374"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:374"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:374"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:374" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:374"
printf "%s\n" "actions.at:374" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:374"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:374"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:374"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "1.1
1.1: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:374"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_326
#AT_START_327
at_fn_group_banner 327 'actions.at:383' \
"Initial location: yacc.c api.pure=full" " " 14
at_xfail=no
(
printf "%s\n" "327. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.pure full
%{
# define YYLTYPE int
# define LOCATION_PRINT(Stream, Loc) \
(void) (Loc)
# define YYLLOC_DEFAULT(Current, Rhs, N) \
(Current) = ((Rhs)[N ? 1 : 0])
%}
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:383"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:383"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:383"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:383"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:383"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:383"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:383" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:383"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:383"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:383"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:383: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:383"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "
: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:383"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_327
#AT_START_328
at_fn_group_banner 328 'actions.at:394' \
"Initial location: yacc.c api.pure=full" " " 14
at_xfail=no
(
printf "%s\n" "328. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%define api.pure full
%{
# define YYLTYPE int
# define LOCATION_PRINT(Stream, Loc) \
fprintf ((Stream), "%d", (Loc))
# define YYLLOC_DEFAULT(Current, Rhs, N) \
(Current) = ((Rhs)[N ? 1 : 0])
%}
%code
{
# include <stdio.h>
# include <stdlib.h> /* getenv */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
static int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
%%
exp: { LOCATION_PRINT(stderr, @$); fputc ('\n', stderr); }
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
YY_USE (lvalp);
YY_USE (llocp);
return 'x';
}
int
main (void)
{
yydebug = !!getenv ("YYDEBUG");
return !!yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:394"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:394"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:394"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:394" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:394"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:394"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:394"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "0
0: syntax error
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:394"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_328
#AT_START_329
at_fn_group_banner 329 'actions.at:478' \
"Location print: yacc.c " " " 14
at_xfail=no
(
printf "%s\n" "329. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "yacc.c"
%code
{
#include <stdio.h> /* putchar. */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: %empty;
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(yylloc).first_line = (yylloc).last_line = 1;
(yylloc).first_column = (yylloc).last_column = toknum;
return res;
}
int
main (void)
{
YYLTYPE loc;
#define TEST(L1, C1, L2, C2) \
loc.first_line = L1; \
loc.first_column = C1; \
loc.last_line = L2; \
loc.last_column = C2; \
LOCATION_PRINT(stdout, loc);\
putchar ('\n');
TEST(1, 1, 1, 1);
TEST(2, 1, 2, 10);
TEST(3, 1, 4, 1);
TEST(5, 1, 6, 10);
TEST(7, 2, 0, 2);
TEST(8, 0, 8, 0);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:478"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:478"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1.1
2.1-9
3.1-4.0
5.1-6.9
7.2
8.0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_329
#AT_START_330
at_fn_group_banner 330 'actions.at:478' \
"Location print: glr.c " " " 14
at_xfail=no
(
printf "%s\n" "330. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr.c"
%code
{
#include <stdio.h> /* putchar. */
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%%
exp: %empty;
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(yylloc).first_line = (yylloc).last_line = 1;
(yylloc).first_column = (yylloc).last_column = toknum;
return res;
}
int
main (void)
{
YYLTYPE loc;
#define TEST(L1, C1, L2, C2) \
loc.first_line = L1; \
loc.first_column = C1; \
loc.last_line = L2; \
loc.last_column = C2; \
LOCATION_PRINT(stdout, loc);\
putchar ('\n');
TEST(1, 1, 1, 1);
TEST(2, 1, 2, 10);
TEST(3, 1, 4, 1);
TEST(5, 1, 6, 10);
TEST(7, 2, 0, 2);
TEST(8, 0, 8, 0);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:478"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:478"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1.1
2.1-9
3.1-4.0
5.1-6.9
7.2
8.0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_330
#AT_START_331
at_fn_group_banner 331 'actions.at:478' \
"Location print: lalr1.cc " " " 14
at_xfail=no
(
printf "%s\n" "331. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "lalr1.cc"
%code
{
#include <stdio.h> /* putchar. */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: %empty;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
int
main (void)
{
yy::parser::location_type loc;
#define TEST(L1, C1, L2, C2) \
loc.begin.line = L1; \
loc.begin.column = C1; \
loc.end.line = L2; \
loc.end.column = C2; \
std::cout << loc;\
putchar ('\n');
TEST(1, 1, 1, 1);
TEST(2, 1, 2, 10);
TEST(3, 1, 4, 1);
TEST(5, 1, 6, 10);
TEST(7, 2, 0, 2);
TEST(8, 0, 8, 0);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:478"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:478"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1.1
2.1-9
3.1-4.0
5.1-6.9
7.2
8.0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_331
#AT_START_332
at_fn_group_banner 332 'actions.at:478' \
"Location print: glr.cc " " " 14
at_xfail=no
(
printf "%s\n" "332. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr.cc"
%code
{
#include <stdio.h> /* putchar. */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: %empty;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
int
main (void)
{
yy::parser::location_type loc;
loc.initialize();
#define TEST(L1, C1, L2, C2) \
loc.begin.line = L1; \
loc.begin.column = C1; \
loc.end.line = L2; \
loc.end.column = C2; \
std::cout << loc;\
putchar ('\n');
TEST(1, 1, 1, 1);
TEST(2, 1, 2, 10);
TEST(3, 1, 4, 1);
TEST(5, 1, 6, 10);
TEST(7, 2, 0, 2);
TEST(8, 0, 8, 0);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:478"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:478"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1.1
2.1-9
3.1-4.0
5.1-6.9
7.2
8.0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_332
#AT_START_333
at_fn_group_banner 333 'actions.at:478' \
"Location print: glr2.cc " " " 14
at_xfail=no
(
printf "%s\n" "333. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%locations
%debug
%skeleton "glr2.cc"
%code
{
#include <stdio.h> /* putchar. */
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%%
exp: %empty;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static char const input[] = "";
static int toknum = 0;
int res;
(void) lvalp;(void) llocp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
(*llocp).begin.line = (*llocp).end.line = 1;
(*llocp).begin.column = (*llocp).end.column = toknum;
return res;
}
int
main (void)
{
yy::parser::location_type loc;
loc.initialize();
#define TEST(L1, C1, L2, C2) \
loc.begin.line = L1; \
loc.begin.column = C1; \
loc.end.line = L2; \
loc.end.column = C2; \
std::cout << loc;\
putchar ('\n');
TEST(1, 1, 1, 1);
TEST(2, 1, 2, 10);
TEST(3, 1, 4, 1);
TEST(5, 1, 6, 10);
TEST(7, 2, 0, 2);
TEST(8, 0, 8, 0);
return 0;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:478"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
printf "%s\n" "actions.at:478" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:478"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:478"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1.1
2.1-9
3.1-4.0
5.1-6.9
7.2
8.0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:478: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:478"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:478"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_333
#AT_START_334
at_fn_group_banner 334 'actions.at:488' \
"Exotic Dollars" " " 14
at_xfail=no
(
printf "%s\n" "334. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%code {
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(Var)
}
%union
{
int val;
};
%type <val> a_1 a_2 a_5
sum_of_the_five_previous_values
%%
exp: a_1 a_2 { $<val>$ = 3; } { $<val>$ = $<val>3 + 1; } a_5
sum_of_the_five_previous_values
{
USE (($1, $2, $<foo>3, $<foo>4, $5));
printf ("%d\n", $6);
}
;
a_1: { $$ = 1; };
a_2: { $$ = 2; };
a_5: { $$ = 5; };
sum_of_the_five_previous_values:
{
$$ = $<val>0 + $<val>-1 + $<val>-2 + $<val>-3 + $<val>-4;
}
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -d -v -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:532"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y" "actions.at:532"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:532"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:532"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:532"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:532: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y"
at_fn_check_prepare_trace "actions.at:532"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -d -v -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:532"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:533" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:533"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:533: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:533"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:533"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:534: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:534"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "15
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:534"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:534: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:534"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:534"
$at_failed && at_fn_log_failure
$at_traceon; }
# Make sure that fields after $n or $-n are parsed correctly. At one
# point while implementing dashes in symbol names, we were dropping
# fields after $-n.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
typedef struct { int val; } stype;
# define YYSTYPE stype
%}
%%
start: one two { $$.val = $1.val + $2.val; } sum ;
one: { $$.val = 1; } ;
two: { $$.val = 2; } ;
sum: { printf ("%d\n", $0.val + $-1.val + $-2.val); } ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:562"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:562"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:562"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:562"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:562" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:562"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:562: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:562"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:562"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:563: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:563"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "6
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:563"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:563: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:563"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:563"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_334
#AT_START_335
at_fn_group_banner 335 'actions.at:1047' \
"Printers and Destructors" " " 14
at_xfail=no
(
printf "%s\n" "335. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%code {
static int yylex (void);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
}
/* FIXME: This %printer isn't actually tested. */
%printer
{
fprintf (yyo, "%d", $$);
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
static
int yylex (void)
{
static int counter = 0;
int c = (yylval) = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(yylloc).first_line = (yylloc).first_column = (10 * c);
(yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
return source[c];
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1047"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1047"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1047"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1047"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1047" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1047"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1047"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:1047"
( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1047: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1047"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: '(' (6@60-69)
sending: 'x' (7@70-79)
thing (7@70-79): 'x' (7@70-79)
sending: ')' (8@80-89)
line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
sending: '(' (9@90-99)
sending: 'x' (10@100-109)
thing (10@100-109): 'x' (10@100-109)
sending: ')' (11@110-119)
line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
sending: '(' (12@120-129)
sending: 'x' (13@130-139)
thing (13@130-139): 'x' (13@130-139)
sending: ')' (14@140-149)
line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
sending: '(' (15@150-159)
sending: 'x' (16@160-169)
thing (16@160-169): 'x' (16@160-169)
sending: ')' (17@170-179)
line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
sending: '(' (18@180-189)
sending: 'x' (19@190-199)
thing (19@190-199): 'x' (19@190-199)
sending: ')' (20@200-209)
200.200-209.208: memory exhausted
Freeing nterm thing (19@190-199)
Freeing nterm line (15@150-179)
Freeing nterm line (12@120-149)
Freeing nterm line (9@90-119)
Freeing nterm line (6@60-89)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Parsing FAILED (status 2).
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1047"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_335
#AT_START_336
at_fn_group_banner 336 'actions.at:1048' \
"Printers and Destructors with union" " " 14
at_xfail=no
(
printf "%s\n" "336. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%union
{
int ival;
}
%code provides {
static int yylex (void);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
}
%type <ival> '(' 'x' 'y' ')' ';' thing line input
'!' raise check-spontaneous-errors END
/* FIXME: This %printer isn't actually tested. */
%printer
{
fprintf (yyo, "%d", $$);
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
static
int yylex (void)
{
static int counter = 0;
int c = (yylval).ival = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(yylloc).first_line = (yylloc).first_column = (10 * c);
(yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
return source[c];
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1048"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1048"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1048"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1048"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1048" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1048"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1048"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: \$PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'" "actions.at:1048"
( $at_check_trace; $PREPARSER ./input '(x)(x)(x)(x)(x)(x)(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1048: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1048"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: '(' (6@60-69)
sending: 'x' (7@70-79)
thing (7@70-79): 'x' (7@70-79)
sending: ')' (8@80-89)
line (6@60-89): '(' (6@60-69) thing (7@70-79) ')' (8@80-89)
sending: '(' (9@90-99)
sending: 'x' (10@100-109)
thing (10@100-109): 'x' (10@100-109)
sending: ')' (11@110-119)
line (9@90-119): '(' (9@90-99) thing (10@100-109) ')' (11@110-119)
sending: '(' (12@120-129)
sending: 'x' (13@130-139)
thing (13@130-139): 'x' (13@130-139)
sending: ')' (14@140-149)
line (12@120-149): '(' (12@120-129) thing (13@130-139) ')' (14@140-149)
sending: '(' (15@150-159)
sending: 'x' (16@160-169)
thing (16@160-169): 'x' (16@160-169)
sending: ')' (17@170-179)
line (15@150-179): '(' (15@150-159) thing (16@160-169) ')' (17@170-179)
sending: '(' (18@180-189)
sending: 'x' (19@190-199)
thing (19@190-199): 'x' (19@190-199)
sending: ')' (20@200-209)
200.200-209.208: memory exhausted
Freeing nterm thing (19@190-199)
Freeing nterm line (15@150-179)
Freeing nterm line (12@120-149)
Freeing nterm line (9@90-119)
Freeing nterm line (6@60-89)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Parsing FAILED (status 2).
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1048"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_336
#AT_START_337
at_fn_group_banner 337 'actions.at:1050' \
"Printers and Destructors: %glr-parser" " " 14
at_xfail=no
(
printf "%s\n" "337. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%glr-parser
%code {
static int yylex (void);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
}
/* FIXME: This %printer isn't actually tested. */
%printer
{
fprintf (yyo, "%d", $$);
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
static
int yylex (void)
{
static int counter = 0;
int c = (yylval) = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(yylloc).first_line = (yylloc).first_column = (10 * c);
(yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
return source[c];
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1050"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1050"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1050"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1050"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1050" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1050"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1050"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1050"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1050: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1050"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1050"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_337
#AT_START_338
at_fn_group_banner 338 'actions.at:1051' \
"Printers and Destructors with union: %glr-parser" "" 14
at_xfail=no
(
printf "%s\n" "338. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).first_line, (Location).last_line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%glr-parser
%union
{
int ival;
}
%code provides {
static int yylex (void);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
}
%type <ival> '(' 'x' 'y' ')' ';' thing line input
'!' raise check-spontaneous-errors END
/* FIXME: This %printer isn't actually tested. */
%printer
{
fprintf (yyo, "%d", $$);
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
static
int yylex (void)
{
static int counter = 0;
int c = (yylval).ival = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(yylloc).first_line = (yylloc).first_column = (10 * c);
(yylloc).last_line = (yylloc).last_column = (yylloc).first_line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((yylloc)));
return source[c];
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1051"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1051"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1051"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1051"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1051" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1051"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1051"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1051"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1051: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1051"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1051"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_338
#AT_START_339
at_fn_group_banner 339 'actions.at:1053' \
"Printers and Destructors: %header lalr1.cc" " " 14
at_xfail=no
(
printf "%s\n" "339. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "lalr1.cc"
%code {
typedef yy::location YYLTYPE;
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp) = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
static bool yydebug;
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1053"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1053"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1053"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1053"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1053" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1053"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1053"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1053"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1053: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1053"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1053"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_339
#AT_START_340
at_fn_group_banner 340 'actions.at:1054' \
"Printers and Destructors with union: %header lalr1.cc" "" 14
at_xfail=no
(
printf "%s\n" "340. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "lalr1.cc"
%union
{
int ival;
}
%code provides {
typedef yy::location YYLTYPE;
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%type <ival> '(' 'x' 'y' ')' ';' thing line input
'!' raise check-spontaneous-errors END
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp).ival = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
static bool yydebug;
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1054"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1054"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1054" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1054"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1054"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1054"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1054: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1054"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1054"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_340
#AT_START_341
at_fn_group_banner 341 'actions.at:1056' \
"Printers and Destructors: %header glr.cc" " " 14
at_xfail=no
(
printf "%s\n" "341. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "glr.cc"
%code {
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp) = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1056"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1056"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1056"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1056"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1056" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1056"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1056"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1056"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1056: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1056"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1056"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_341
#AT_START_342
at_fn_group_banner 342 'actions.at:1057' \
"Printers and Destructors with union: %header glr.cc" "" 14
at_xfail=no
(
printf "%s\n" "342. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "glr.cc"
%union
{
int ival;
}
%code provides {
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%type <ival> '(' 'x' 'y' ')' ';' thing line input
'!' raise check-spontaneous-errors END
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp).ival = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1057"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1057"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1057"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1057"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1057" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1057"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1057"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1057"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1057: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1057"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1057"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_342
#AT_START_343
at_fn_group_banner 343 'actions.at:1059' \
"Printers and Destructors: %header glr2.cc" " " 14
at_xfail=no
(
printf "%s\n" "343. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "glr2.cc"
%code {
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp) = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1059"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1059"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1059"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1059"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1059" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1059"
printf "%s\n" "actions.at:1059" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1059"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1059"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1059"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1059: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1059"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1059"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_343
#AT_START_344
at_fn_group_banner 344 'actions.at:1060' \
"Printers and Destructors with union: %header glr2.cc" "" 14
at_xfail=no
(
printf "%s\n" "344. $at_setup_line: testing $at_desc ..."
$at_traceon
# Make sure complex $n work.
# Be sure to pass all the %directives to this macro to have correct
# helping macros. So don't put any directly in the Bison file.
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code requires {
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#define YYINITDEPTH 10
#define YYMAXDEPTH 10
#define RANGE(Location) (Location).begin.line, (Location).end.line
#define USE(SYM)
/* Display the symbol type Symbol. */
#define V(Symbol, Value, Location, Sep) \
fprintf (stderr, #Symbol " (%d@%d-%d)%s", Value, RANGE(Location), Sep)
}
%define parse.error verbose
%debug
%verbose
%locations
%header %skeleton "glr2.cc"
%union
{
int ival;
}
%code provides {
static int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%type <ival> '(' 'x' 'y' ')' ';' thing line input
'!' raise check-spontaneous-errors END
/* FIXME: This %printer isn't actually tested. */
%printer
{
yyo << $$;;
}
'(' 'x' 'y' ')' ';' thing line input '!' raise check-spontaneous-errors END
%destructor
{ fprintf (stderr, "Freeing nterm input (%d@%d-%d)\n", $$, RANGE (@$)); }
input
%destructor
{ fprintf (stderr, "Freeing nterm line (%d@%d-%d)\n", $$, RANGE (@$)); }
line
%destructor
{ fprintf (stderr, "Freeing nterm thing (%d@%d-%d)\n", $$, RANGE (@$)); }
thing
%destructor
{ fprintf (stderr, "Freeing nterm raise (%d@%d-%d)\n", $$, RANGE (@$)); }
raise
%destructor
{ fprintf (stderr, "Freeing nterm check-spontaneous-errors (%d@%d-%d)\n", $$, RANGE (@$)); }
check-spontaneous-errors
%destructor
{ fprintf (stderr, "Freeing token 'x' (%d@%d-%d)\n", $$, RANGE (@$)); }
'x'
%destructor
{ fprintf (stderr, "Freeing token 'y' (%d@%d-%d)\n", $$, RANGE (@$)); }
'y'
%token END 0
%destructor
{ fprintf (stderr, "Freeing token END (%d@%d-%d)\n", $$, RANGE (@$)); }
END
%%
/*
This grammar is made to exercise error recovery.
"Lines" starting with '(' support error recovery, with
')' as synchronizing token. Lines starting with 'x' can never
be recovered from if in error.
*/
input:
%empty
{
$$ = 0;
V(input, $$, @$, ": /* Nothing */\n");
}
| line input /* Right recursive to load the stack so that popping at
END can be exercised. */
{
$$ = 2;
V(input, $$, @$, ": ");
V(line, $1, @1, " ");
V(input, $2, @2, "\n");
}
| '!' check-spontaneous-errors
{
$$ = $2;
}
;
check-spontaneous-errors:
raise { abort(); USE(($$, $1)); }
| '(' raise ')' { abort(); USE(($$, $2)); }
| error
{
$$ = 5;
V(check-spontaneous-errors, $$, @$, ": ");
fprintf (stderr, "error (@%d-%d)\n", RANGE(@1));
}
;
raise:
%empty
{
$$ = 4;
V(raise, $$, @$, ": %empty\n");
YYERROR;
}
| '!' '!'
{
$$ = 5;
V(raise, $$, @$, ": ");
V(!, $1, @2, " ");
V(!, $2, @2, "\n");
YYERROR;
}
;
line:
thing thing thing ';'
{
$$ = $1;
V(line, $$, @$, ": ");
V(thing, $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(;, $4, @4, "\n");
}
| '(' thing thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(thing, $3, @3, " ");
V(')', $4, @4, "\n");
}
| '(' thing ')'
{
$$ = $1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
V(thing, $2, @2, " ");
V(')', $3, @3, "\n");
}
| '(' error ')'
{
$$ = -1;
V(line, $$, @$, ": ");
V('(', $1, @1, " ");
fprintf (stderr, "error (@%d-%d) ", RANGE(@2));
V(')', $3, @3, "\n");
}
;
thing:
'x'
{
$$ = $1;
V(thing, $$, @$, ": ");
V('x', $1, @1, "\n");
}
;
%%
/* Alias to ARGV[1]. */
const char *source = YY_NULLPTR;
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
static
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
static int counter = 0;
int c = (*lvalp).ival = counter++;
assert (c <= YY_CAST (int, strlen (source)));
/* As in BASIC, line numbers go from 10 to 10. */
(*llocp).begin.line = (*llocp).begin.column = (10 * c);
(*llocp).end.line = (*llocp).end.column = (*llocp).begin.line + 9;
if (source[c])
fprintf (stderr, "sending: '%c'", source[c]);
else
fprintf (stderr, "sending: END");
fprintf (stderr, " (%d@%d-%d)\n", c, RANGE ((*llocp)));
return source[c];
}
int
yyparse ()
{
yy::parser parser;
parser.set_debug_level (yydebug);
return parser.parse ();
}
int
main (int argc, const char *argv[])
{
int status;
yydebug = !!getenv ("YYDEBUG");
assert (argc == 2); (void) argc;
source = argv[1];
status = yyparse ();
switch (status)
{
case 0: fprintf (stderr, "Successful parse.\n"); break;
case 1: fprintf (stderr, "Parsing FAILED.\n"); break;
default: fprintf (stderr, "Parsing FAILED (status %d).\n", status); break;
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1060"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1060"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1060"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1060"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1060" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1060"
printf "%s\n" "actions.at:1060" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1060"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1060"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of "empty"
# -----------------------------
# I.e., epsilon-reductions, as in "(x)" which ends by reducing
# an empty "line" nterm.
# FIXME: This location is not satisfying. Depend on the lookahead?
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '(x)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '(x)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (0@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of empty reductions raising an error
# -------------------------------------------------------
# Here, the error is after token "!@0-9", so the error is raised from
# @9-9, and the error recovery detects that it starts from @9-9 and
# ends where starts the next token: END@10-19.
#
# So error recovery reports error@9-19.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: END (1@10-19)
raise (4@9-9): %empty
check-spontaneous-errors (5@9-19): error (@9-19)
Freeing token END (1@10-19)
Freeing nterm input (5@0-19)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check the location of not empty reductions raising an error
# -----------------------------------------------------------
# This time the error is raised from a rule with 2 rhs symbols: @10-29.
# It is recovered @10-29.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '!!!'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '!!!'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '!!!'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '!' (0@0-9)
sending: '!' (1@10-19)
sending: '!' (2@20-29)
raise (5@10-29): ! (1@20-29) ! (2@20-29)
check-spontaneous-errors (5@10-29): error (@10-29)
sending: END (3@30-39)
Freeing token END (3@30-39)
Freeing nterm input (5@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check locations in error recovery
# ---------------------------------
# '(y)' is an error, but can be recovered from. But what's the location
# of the error itself ('y'), and of the resulting reduction ('(error)').
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '(y)'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(y)'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '(y)'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'y' (1@10-19)
10.10-19.18: syntax error, unexpected 'y', expecting 'x'
Freeing token 'y' (1@10-19)
sending: ')' (2@20-29)
line (-1@0-29): '(' (0@0-9) error (@10-19) ')' (2@20-29)
sending: END (3@30-39)
input (0@29-29): /* Nothing */
input (2@0-29): line (-1@0-29) input (0@29-29)
Freeing token END (3@30-39)
Freeing nterm input (2@0-29)
Successful parse.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax errors caught by the parser
# ----------------------------------
# Exercise the discarding of stack top and input until 'error'
# can be reduced.
#
# '(', 'x', 'x', 'x', 'x', 'x', ')',
#
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'y'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '(xxxxx)(x)(x)y'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(xxxxx)(x)(x)y'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '(xxxxx)(x)(x)y'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: 'x' (2@20-29)
thing (2@20-29): 'x' (2@20-29)
sending: 'x' (3@30-39)
30.30-39.38: syntax error, unexpected 'x', expecting ')'
Freeing nterm thing (2@20-29)
Freeing nterm thing (1@10-19)
Freeing token 'x' (3@30-39)
sending: 'x' (4@40-49)
Freeing token 'x' (4@40-49)
sending: 'x' (5@50-59)
Freeing token 'x' (5@50-59)
sending: ')' (6@60-69)
line (-1@0-69): '(' (0@0-9) error (@10-59) ')' (6@60-69)
sending: '(' (7@70-79)
sending: 'x' (8@80-89)
thing (8@80-89): 'x' (8@80-89)
sending: ')' (9@90-99)
line (7@70-99): '(' (7@70-79) thing (8@80-89) ')' (9@90-99)
sending: '(' (10@100-109)
sending: 'x' (11@110-119)
thing (11@110-119): 'x' (11@110-119)
sending: ')' (12@120-129)
line (10@100-129): '(' (10@100-109) thing (11@110-119) ')' (12@120-129)
sending: 'y' (13@130-139)
input (0@129-129): /* Nothing */
input (2@100-129): line (10@100-129) input (0@129-129)
input (2@70-129): line (7@70-99) input (2@100-129)
input (2@0-129): line (-1@0-69) input (2@70-129)
130.130-139.138: syntax error, unexpected 'y', expecting END
Freeing nterm input (2@0-129)
Freeing token 'y' (13@130-139)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Syntax error caught by the parser where lookahead = END
# --------------------------------------------------------
# Load the stack and provoke an error that cannot be caught by the
# grammar, to check that the stack is cleared. And make sure the
# lookahead is freed.
#
# '(', 'x', ')',
# '(', 'x', ')',
# 'x'
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: \$PREPARSER ./input '(x)(x)x'"
at_fn_check_prepare_dynamic " $PREPARSER ./input '(x)(x)x'" "actions.at:1060"
( $at_check_trace; $PREPARSER ./input '(x)(x)x'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1060: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1060"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "sending: '(' (0@0-9)
sending: 'x' (1@10-19)
thing (1@10-19): 'x' (1@10-19)
sending: ')' (2@20-29)
line (0@0-29): '(' (0@0-9) thing (1@10-19) ')' (2@20-29)
sending: '(' (3@30-39)
sending: 'x' (4@40-49)
thing (4@40-49): 'x' (4@40-49)
sending: ')' (5@50-59)
line (3@30-59): '(' (3@30-39) thing (4@40-49) ')' (5@50-59)
sending: 'x' (6@60-69)
thing (6@60-69): 'x' (6@60-69)
sending: END (7@70-79)
70.70-79.78: syntax error, unexpected END, expecting 'x'
Freeing nterm thing (6@60-69)
Freeing nterm line (3@30-59)
Freeing nterm line (0@0-29)
Freeing token END (7@70-79)
Parsing FAILED.
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1060"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check destruction upon stack overflow
# -------------------------------------
# Upon stack overflow, all symbols on the stack should be destroyed.
# Only check for yacc.c.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_344
#AT_START_345
at_fn_group_banner 345 'actions.at:1071' \
"Default tagless %printer and %destructor" " " 14
at_xfail=no
(
printf "%s\n" "345. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%locations
%code {
static int yylex (void);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
# define USE(SYM)
}
%printer {
#error "<*> printer should not be used."
} <*>
%printer {
fprintf (yyo, "<> printer for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
printf ("<> destructor for '%c' @ %d.\n", $$, @$.first_column);
} <>
%printer {
fprintf (yyo, "'b'/'c' printer for '%c' @ %d", $$, @$.first_column);
} 'b' 'c'
%destructor {
printf ("'b'/'c' destructor for '%c' @ %d.\n", $$, @$.first_column);
} 'b' 'c'
%destructor {
#error "<*> destructor should not be used."
} <*>
%%
start: 'a' 'b' 'c' 'd' 'e' { $$ = 'S'; USE(($1, $2, $3, $4, $5)); } ;
%%
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "abcd";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
yylval = res;
(yylloc).first_line = (yylloc).last_line = 1;
(yylloc).first_column = (yylloc).last_column = toknum;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1116"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1116"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:30.3-5: warning: useless %destructor for type <*> [-Wother]
input.y:30.3-5: warning: useless %printer for type <*> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:30.3-5: warning: useless %destructor for type <*> [-Wother]
input.y:30.3-5: warning: useless %printer for type <*> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1116"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1116: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1116"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1116"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1120" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1120"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1120: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1120"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1120"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1121: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1121"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "<> destructor for 'd' @ 4.
'b'/'c' destructor for 'c' @ 3.
'b'/'c' destructor for 'b' @ 2.
<> destructor for 'a' @ 1.
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1121"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1121: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1121"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reading a token
Next token is token 'a' (1.1: <> printer for 'a' @ 1)
Shifting token 'a' (1.1: <> printer for 'a' @ 1)
Entering state 1
Stack now 0 1
Reading a token
Next token is token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
Shifting token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
Entering state 3
Stack now 0 1 3
Reading a token
Next token is token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
Shifting token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
Entering state 5
Stack now 0 1 3 5
Reading a token
Next token is token 'd' (1.4: <> printer for 'd' @ 4)
Shifting token 'd' (1.4: <> printer for 'd' @ 4)
Entering state 6
Stack now 0 1 3 5 6
Reading a token
Now at end of input.
1.5: syntax error, unexpected end of file, expecting 'e'
Error: popping token 'd' (1.4: <> printer for 'd' @ 4)
Stack now 0 1 3 5
Error: popping token 'c' (1.3: 'b'/'c' printer for 'c' @ 3)
Stack now 0 1 3
Error: popping token 'b' (1.2: 'b'/'c' printer for 'b' @ 2)
Stack now 0 1
Error: popping token 'a' (1.1: <> printer for 'a' @ 1)
Stack now 0
Cleanup: discarding lookahead token \"end of file\" (1.5: )
Stack now 0
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1121"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_345
#AT_START_346
at_fn_group_banner 346 'actions.at:1174' \
"Default tagged and per-type %printer and %destructor" "" 14
at_xfail=no
(
printf "%s\n" "346. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}
%printer {
#error "<> printer should not be used."
} <>
%union { int field0; int field1; int field2; }
%type <field0> start 'a' 'g'
%type <field1> 'e'
%type <field2> 'f'
%printer {
fprintf (yyo, "<*>/<field2>/e printer");
} <*> 'e' <field2>
%destructor {
printf ("<*>/<field2>/e destructor.\n");
} <*> 'e' <field2>
%type <field1> 'b'
%printer { fprintf (yyo, "<field1> printer"); } <field1>
%destructor { printf ("<field1> destructor.\n"); } <field1>
%type <field0> 'c'
%printer { fprintf (yyo, "'c' printer"); } 'c'
%destructor { printf ("'c' destructor.\n"); } 'c'
%type <field1> 'd'
%printer { fprintf (yyo, "'d' printer"); } 'd'
%destructor { printf ("'d' destructor.\n"); } 'd'
%destructor {
#error "<> destructor should not be used."
} <>
%%
start:
'a' 'b' 'c' 'd' 'e' 'f' 'g'
{
USE(($1, $2, $3, $4, $5, $6, $7));
$$ = 'S';
}
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "abcdef";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1233"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1233"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1233"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:22.3-4: warning: useless %destructor for type <> [-Wother]
input.y:22.3-4: warning: useless %printer for type <> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:22.3-4: warning: useless %destructor for type <> [-Wother]
input.y:22.3-4: warning: useless %printer for type <> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1233"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1233: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1233"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1233"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1237" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1237"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1237: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1237"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1237"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1238: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1238"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "<*>/<field2>/e destructor.
<*>/<field2>/e destructor.
'd' destructor.
'c' destructor.
<field1> destructor.
<*>/<field2>/e destructor.
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1238"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1238: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1238"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reading a token
Next token is token 'a' (<*>/<field2>/e printer)
Shifting token 'a' (<*>/<field2>/e printer)
Entering state 1
Stack now 0 1
Reading a token
Next token is token 'b' (<field1> printer)
Shifting token 'b' (<field1> printer)
Entering state 3
Stack now 0 1 3
Reading a token
Next token is token 'c' ('c' printer)
Shifting token 'c' ('c' printer)
Entering state 5
Stack now 0 1 3 5
Reading a token
Next token is token 'd' ('d' printer)
Shifting token 'd' ('d' printer)
Entering state 6
Stack now 0 1 3 5 6
Reading a token
Next token is token 'e' (<*>/<field2>/e printer)
Shifting token 'e' (<*>/<field2>/e printer)
Entering state 7
Stack now 0 1 3 5 6 7
Reading a token
Next token is token 'f' (<*>/<field2>/e printer)
Shifting token 'f' (<*>/<field2>/e printer)
Entering state 8
Stack now 0 1 3 5 6 7 8
Reading a token
Now at end of input.
syntax error, unexpected end of file, expecting 'g'
Error: popping token 'f' (<*>/<field2>/e printer)
Stack now 0 1 3 5 6 7
Error: popping token 'e' (<*>/<field2>/e printer)
Stack now 0 1 3 5 6
Error: popping token 'd' ('d' printer)
Stack now 0 1 3 5
Error: popping token 'c' ('c' printer)
Stack now 0 1 3
Error: popping token 'b' (<field1> printer)
Stack now 0 1
Error: popping token 'a' (<*>/<field2>/e printer)
Stack now 0
Cleanup: discarding lookahead token \"end of file\" ()
Stack now 0
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1238"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_346
#AT_START_347
at_fn_group_banner 347 'actions.at:1307' \
"Default %printer and %destructor for user-defined end token" "" 14
at_xfail=no
(
printf "%s\n" "347. $at_setup_line: testing $at_desc ..."
$at_traceon
# Enable declaration of default %printer/%destructor. Make the parser
# use these for all user-declared grammar symbols for which the user
# does not declare a specific %printer/%destructor. Thus, the parser
# uses it for token 0 if the user declares it but not if Bison
# generates it as $end. Discussed starting at
# <https://lists.gnu.org/r/bison-patches/2006-02/msg00064.html>,
# <https://lists.gnu.org/r/bison-patches/2006-06/msg00091.html>, and
# <https://lists.gnu.org/r/bison-patches/2006-07/msg00019.html>.
# AT_TEST(TYPED)
# --------------
cat >input0.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%locations
%code {
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
}
%destructor {
#error "<*> destructor should not be used."
} <*>
%token END 0
%printer {
fprintf (yyo, "<> for '%c' @ %d", $$, @$.first_column);
} <>
%destructor {
printf ("<> for '%c' @ %d.\n", $$, @$.first_column);
} <>
%printer {
#error "<*> printer should not be used."
} <*>
%%
start: { $$ = 'S'; } ;
%%
#include <stdlib.h> /* abort */
static int
yylex (void)
{
static int called;
if (called++)
abort ();
yylval = 'E';
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
return 0;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input0.c input0.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y" "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1416"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1416"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1416"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input0.c input0.y"
at_fn_check_prepare_trace "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input0.c input0.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother]
input0.y:30.3-5: warning: useless %printer for type <*> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror" "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input0.y:30.3-5: warning: useless %destructor for type <*> [-Wother]
input0.y:30.3-5: warning: useless %printer for type <*> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1416"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error" "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none" "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none" "actions.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input0.c input0.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1416" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1416"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input0 input0.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS" "actions.at:1416"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input0 input0.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: \$PREPARSER ./input0 --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input0 --debug" "actions.at:1416"
( $at_check_trace; $PREPARSER ./input0 --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "<> for 'E' @ 1.
<> for 'S' @ 1.
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reducing stack by rule 1 (line 49):
-> \$\$ = nterm start (1.1: <> for 'S' @ 1)
Entering state 1
Stack now 0 1
Reading a token
Now at end of input.
Shifting token END (1.1: <> for 'E' @ 1)
Entering state 2
Stack now 0 1 2
Stack now 0 1 2
Cleanup: popping token END (1.1: <> for 'E' @ 1)
Cleanup: popping nterm start (1.1: <> for 'S' @ 1)
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input1.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%locations
%code {
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
}
%destructor {
#error "<> destructor should not be used."
} <>
%token END 0
%printer {
fprintf (yyo, "<*> for '%c' @ %d", $$, @$.first_column);
} <*>
%destructor {
printf ("<*> for '%c' @ %d.\n", $$, @$.first_column);
} <*>
%printer {
#error "<> printer should not be used."
} <>
%union { char tag; }
%type <tag> start END
%%
start: { $$ = 'S'; } ;
%%
#include <stdlib.h> /* abort */
static int
yylex (void)
{
static int called;
if (called++)
abort ();
yylval.tag = 'E';
yylloc.first_line = yylloc.last_line = 1;
yylloc.first_column = yylloc.last_column = 1;
return 0;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input1.c input1.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y" "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1417"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1417"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1417"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input1.c input1.y"
at_fn_check_prepare_trace "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input1.c input1.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input1.y:30.3-4: warning: useless %destructor for type <> [-Wother]
input1.y:30.3-4: warning: useless %printer for type <> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror" "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input1.y:30.3-4: warning: useless %destructor for type <> [-Wother]
input1.y:30.3-4: warning: useless %printer for type <> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1417"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error" "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none" "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none" "actions.at:1417"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input1.c input1.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1417" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1417"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input1 input1.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS" "actions.at:1417"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input1 input1.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: \$PREPARSER ./input1 --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input1 --debug" "actions.at:1417"
( $at_check_trace; $PREPARSER ./input1 --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "<*> for 'E' @ 1.
<*> for 'S' @ 1.
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1417: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1417"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reducing stack by rule 1 (line 49):
-> \$\$ = nterm start (1.1: <*> for 'S' @ 1)
Entering state 1
Stack now 0 1
Reading a token
Now at end of input.
Shifting token END (1.1: <*> for 'E' @ 1)
Entering state 2
Stack now 0 1 2
Stack now 0 1 2
Cleanup: popping token END (1.1: <*> for 'E' @ 1)
Cleanup: popping nterm start (1.1: <*> for 'S' @ 1)
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1417"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_347
#AT_START_348
at_fn_group_banner 348 'actions.at:1429' \
"Default %printer and %destructor are not for error or \$undefined" "" 14
at_xfail=no
(
printf "%s\n" "348. $at_setup_line: testing $at_desc ..."
$at_traceon
# If Bison were to apply the default %printer and %destructor to the error
# token or to $undefined:
# - For the error token:
# - It would generate warnings for unused $n.
# - It would invoke the %printer and %destructor on the error token's
# semantic value, which would be initialized from the lookahead, which
# would be destroyed separately.
# - For $undefined, who knows what the semantic value would be.
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}
%printer {
fprintf (yyo, "'%c'", $$);
} <> <*>
%destructor {
fprintf (stderr, "DESTROY '%c'\n", $$);
} <> <*>
%%
start:
{ $$ = 'S'; }
/* In order to reveal the problems that this bug caused during parsing, add
* $2 to USE. */
| 'a' error 'b' 'c' { USE(($1, $3, $4)); $$ = 'S'; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "abd";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
yylval = res;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1474"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1474"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1474"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:23.6-8: warning: useless %destructor for type <*> [-Wother]
input.y:23.6-8: warning: useless %printer for type <*> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:23.6-8: warning: useless %destructor for type <*> [-Wother]
input.y:23.6-8: warning: useless %printer for type <*> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1474"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1474: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1474"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1474"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1478" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1478"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1478: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1478"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1478"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1479: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1479"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1479"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1479: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1479"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reading a token
Next token is token 'a' ('a')
Shifting token 'a' ('a')
Entering state 1
Stack now 0 1
Reading a token
Next token is token 'b' ('b')
syntax error
Shifting token error ()
Entering state 3
Stack now 0 1 3
Next token is token 'b' ('b')
Shifting token 'b' ('b')
Entering state 5
Stack now 0 1 3 5
Reading a token
Next token is token \"invalid token\" ()
Error: popping token 'b' ('b')
DESTROY 'b'
Stack now 0 1 3
Error: popping token error ()
Stack now 0 1
Shifting token error ()
Entering state 3
Stack now 0 1 3
Next token is token \"invalid token\" ()
Error: discarding token \"invalid token\" ()
Error: popping token error ()
Stack now 0 1
Shifting token error ()
Entering state 3
Stack now 0 1 3
Reading a token
Now at end of input.
Cleanup: discarding lookahead token \"end of file\" ()
Stack now 0 1 3
Cleanup: popping token error ()
Cleanup: popping token 'a' ('a')
DESTROY 'a'
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1479"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_348
#AT_START_349
at_fn_group_banner 349 'actions.at:1532' \
"Default %printer and %destructor are not for \$accept" "" 14
at_xfail=no
(
printf "%s\n" "349. $at_setup_line: testing $at_desc ..."
$at_traceon
# If YYSTYPE is a union and Bison were to apply the default %printer and
# %destructor to $accept:
# - The %printer and %destructor code generated for $accept would always be
# dead code because $accept is currently never shifted onto the stack.
# - $$ for $accept would always be of type YYSTYPE because it's not possible
# to declare '%type <field> $accept'. (Also true for $undefined.)
# - Thus, the compiler might complain that the user code assumes the wrong
# type for $$ since the code might assume the type associated with a
# specific union field, which is especially reasonable in C++ since that
# type may be a base type. This test case checks for this problem. (Also
# true for $undefined and the error token, so there are three warnings for
# %printer and three for %destructor.)
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug /* So that %printer is actually compiled. */
%{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
%}
%printer {
char chr = $$;
fprintf (yyo, "'%c'", chr);
} <> <*>
%destructor {
char chr = $$;
fprintf (stderr, "DESTROY '%c'\n", chr);
} <> <*>
%union { char chr; }
%type <chr> start
%%
start: { USE($$); } ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1582"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1582"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1582"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:24.3-4: warning: useless %destructor for type <> [-Wother]
input.y:24.3-4: warning: useless %printer for type <> [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:24.3-4: warning: useless %destructor for type <> [-Wother]
input.y:24.3-4: warning: useless %printer for type <> [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1582"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1582: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1582"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1582"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1586" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1586"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1586: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1586"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1586"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_349
#AT_START_350
at_fn_group_banner 350 'actions.at:1596' \
"Default %printer and %destructor for midrule values" "" 14
at_xfail=no
(
printf "%s\n" "350. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug /* So that %printer is actually compiled. */
%{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
# define USE(SYM)
# define YYLTYPE int
# define YYLLOC_DEFAULT(Current, Rhs, N) (void)(Rhs)
# define LOCATION_PRINT(File, Loc)
%}
%printer { fprintf (yyo, "%d", @$); } <>
%destructor { fprintf (stderr, "DESTROY %d\n", @$); } <>
%printer { #error "<*> printer should not be used" } <*>
%destructor { #error "<*> destructor should not be used" } <*>
%%
start:
{ @$ = 1; } // Not set or used.
{ USE ($$); @$ = 2; } // Both set and used.
{ USE ($$); @$ = 3; } // Only set.
{ @$ = 4; } // Only used.
'c'
{ USE (($$, $2, $4, $5)); @$ = 0; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1634"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1634"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1634"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:24.57-59: warning: useless %destructor for type <*> [-Wother]
input.y:24.57-59: warning: useless %printer for type <*> [-Wother]
input.y:33.3-23: warning: unset value: \$\$ [-Wother]
input.y:32.3-23: warning: unused value: \$3 [-Wother]
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror" "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:24.57-59: warning: useless %destructor for type <*> [-Wother]
input.y:24.57-59: warning: useless %printer for type <*> [-Wother]
input.y:33.3-23: warning: unset value: $$ [-Wother]
input.y:32.3-23: warning: unused value: $3 [-Wother]
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1634"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error" "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1634: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1634"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1634"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -fcaret -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y" "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1641"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1641"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1641"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -fcaret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:24.57-59: warning: useless %destructor for type <*> [-Wother]
24 | %printer { #error \"<*> printer should not be used\" } <*>
| ^~~
input.y:24.57-59: warning: useless %printer for type <*> [-Wother]
24 | %printer { #error \"<*> printer should not be used\" } <*>
| ^~~
input.y:33.3-23: warning: unset value: \$\$ [-Wother]
33 | { @\$ = 4; } // Only used.
| ^~~~~~~~~~~~~~~~~~~~~
input.y:32.3-23: warning: unused value: \$3 [-Wother]
32 | { USE (\$\$); @\$ = 3; } // Only set.
| ^~~~~~~~~~~~~~~~~~~~~
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
# Defining POSIXLY_CORRECT causes bison to complain if options are
# added after the grammar file name, so skip these checks in that
# case.
if test "$POSIXLY_CORRECT_IS_EXPORTED" = false; then
at_save_special_files
# To avoid expanding it repeatedly, store specified stdout.
: >expout
# Run with -Werror.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror" "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Werror
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
# Build expected stderr up to and including the "warnings being
# treated as errors" message.
cat >experr <<'_ATEOF'
input.y:24.57-59: warning: useless %destructor for type <*> [-Wother]
24 | %printer { #error "<*> printer should not be used" } <*>
| ^~~
input.y:24.57-59: warning: useless %printer for type <*> [-Wother]
24 | %printer { #error "<*> printer should not be used" } <*>
| ^~~
input.y:33.3-23: warning: unset value: $$ [-Wother]
33 | { @$ = 4; } // Only used.
| ^~~~~~~~~~~~~~~~~~~~~
input.y:32.3-23: warning: unused value: $3 [-Wother]
32 | { USE ($$); @$ = 3; } // Only set.
| ^~~~~~~~~~~~~~~~~~~~~
_ATEOF
"$PERL" -pi -e 's{(.*): warning:}{$1: error:};' \
-e 's{\[-W(.*)\]$}{[-Werror=$1]}' \
experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: sed 's,.*/\$,,' stderr 1>&2"
at_fn_check_prepare_dynamic "sed 's,.*/$,,' stderr 1>&2" "actions.at:1641"
( $at_check_trace; sed 's,.*/$,,' stderr 1>&2
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
# Now check --warnings=error.
cp stderr experr
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error" "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=error
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
$at_diff experr "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Now check -Wnone and --warnings=none by making sure that
# -Werror doesn't change the exit status when -Wnone or
# --warnings=none is specified. With traces disabled, there should
# be no output on stderr.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none" "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y -Wnone,none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1641: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none" "actions.at:1641"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret -fcaret -o input.c input.y --warnings=none -Werror --trace=none
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1641"
$at_failed && at_fn_log_failure
$at_traceon; }
at_restore_special_files
fi
printf "%s\n" "actions.at:1656" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1656"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1656: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1656"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1656"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1657: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1657"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/actions.at:1657"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1657: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1657"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "Starting parse
Entering state 0
Stack now 0
Reducing stack by rule 1 (line 30):
-> \$\$ = nterm \$@1 (: )
Entering state 2
Stack now 0 2
Reducing stack by rule 2 (line 31):
-> \$\$ = nterm @2 (: 2)
Entering state 4
Stack now 0 2 4
Reducing stack by rule 3 (line 32):
-> \$\$ = nterm @3 (: 3)
Entering state 5
Stack now 0 2 4 5
Reducing stack by rule 4 (line 33):
-> \$\$ = nterm @4 (: 4)
Entering state 6
Stack now 0 2 4 5 6
Reading a token
Now at end of input.
syntax error
Error: popping nterm @4 (: 4)
DESTROY 4
Stack now 0 2 4 5
Error: popping nterm @3 (: 3)
DESTROY 3
Stack now 0 2 4
Error: popping nterm @2 (: 2)
DESTROY 2
Stack now 0 2
Error: popping nterm \$@1 (: )
Stack now 0
Cleanup: discarding lookahead token \"end of file\" (: )
Stack now 0
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1657"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_350
#AT_START_351
at_fn_group_banner 351 'actions.at:1743' \
"@\$ in %initial-action implies %locations" " " 14
at_xfail=no
(
printf "%s\n" "351. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%debug
%initial-action {
fprintf (stderr, "%d\n", @$.first_line);
}
%%
start: ;
%%
static int
yylex (void)
{
return 0;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1743"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1743"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1743"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1743"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1743"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1743"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1743" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1743"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1743: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1743"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1743"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_351
#AT_START_352
at_fn_group_banner 352 'actions.at:1744' \
"@\$ in %destructor implies %locations" " " 14
at_xfail=no
(
printf "%s\n" "352. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%debug
%destructor {
fprintf (stderr, "%d\n", @$.first_line);
} start
%%
start: ;
%%
static int
yylex (void)
{
return 0;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1744"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1744"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1744"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1744"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1744"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1744"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1744" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1744"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1744: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1744"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1744"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_352
#AT_START_353
at_fn_group_banner 353 'actions.at:1745' \
"@\$ in %printer implies %locations" " " 14
at_xfail=no
(
printf "%s\n" "353. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%debug
%printer {
fprintf (stderr, "%d\n", @$.first_line);
} start
%%
start: ;
%%
static int
yylex (void)
{
return 0;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1745"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1745"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1745"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1745"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1745"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1745"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1745" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1745"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1745: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1745"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1745"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_353
#AT_START_354
at_fn_group_banner 354 'actions.at:1856' \
"Qualified \$\$ in actions: yacc.c" " " 14
at_xfail=no
(
printf "%s\n" "354. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c"
%debug
%code requires
{
typedef struct sem_type
{
int ival;
float fval;
} sem_type;
# include <stdio.h>
static void
report (FILE* yyo, int ival, float fval)
{
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
}
}
%define api.value.type {sem_type}
%code
{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%token UNTYPED
%token <ival> INT
%type <fval> float
%printer { report (yyo, $$, $<fval>$); } <ival>;
%printer { report (yyo, $<ival>$, $$ ); } <fval>;
%printer { report (yyo, $<ival>$, $<fval>$); } <>;
%initial-action
{
$<ival>$ = 42;
$<fval>$ = 4.2f;
}
%%
float: UNTYPED INT
{
$$ = $<fval>1 + $<fval>2;
$<ival>$ = $<ival>1 + $2;
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {UNTYPED, INT, EOF};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
(yylval).ival = toknum * 10;
(yylval).fval = YY_CAST (float, toknum) / 10.0f;;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1856"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1856"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# Don't be too picky on the traces, GLR is not exactly the same. Keep
# only the lines from the printer.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -ne '/ival:/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Next token is token INT (ival: 20, fval: 0.2)
Shifting token INT (ival: 20, fval: 0.2)
\$1 = token UNTYPED (ival: 10, fval: 0.1)
\$2 = token INT (ival: 20, fval: 0.2)
-> \$\$ = nterm float (ival: 30, fval: 0.3)
Cleanup: popping nterm float (ival: 30, fval: 0.3)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_354
#AT_START_355
at_fn_group_banner 355 'actions.at:1856' \
"Qualified \$\$ in actions: glr.c" " " 14
at_xfail=no
(
printf "%s\n" "355. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.c"
%debug
%code requires
{
typedef struct sem_type
{
int ival;
float fval;
} sem_type;
# include <stdio.h>
static void
report (FILE* yyo, int ival, float fval)
{
fprintf (yyo, "ival: %d, fval: %1.1f", ival, fval);
}
}
%define api.value.type {sem_type}
%code
{
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%token UNTYPED
%token <ival> INT
%type <fval> float
%printer { report (yyo, $$, $<fval>$); } <ival>;
%printer { report (yyo, $<ival>$, $$ ); } <fval>;
%printer { report (yyo, $<ival>$, $<fval>$); } <>;
%initial-action
{
$<ival>$ = 42;
$<fval>$ = 4.2f;
}
%%
float: UNTYPED INT
{
$$ = $<fval>1 + $<fval>2;
$<ival>$ = $<ival>1 + $2;
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = {UNTYPED, INT, EOF};
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
(yylval).ival = toknum * 10;
(yylval).fval = YY_CAST (float, toknum) / 10.0f;;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1856"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1856"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# Don't be too picky on the traces, GLR is not exactly the same. Keep
# only the lines from the printer.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -ne '/ival:/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Next token is token INT (ival: 20, fval: 0.2)
Shifting token INT (ival: 20, fval: 0.2)
\$1 = token UNTYPED (ival: 10, fval: 0.1)
\$2 = token INT (ival: 20, fval: 0.2)
-> \$\$ = nterm float (ival: 30, fval: 0.3)
Cleanup: popping nterm float (ival: 30, fval: 0.3)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_355
#AT_START_356
at_fn_group_banner 356 'actions.at:1856' \
"Qualified \$\$ in actions: lalr1.cc" " " 14
at_xfail=no
(
printf "%s\n" "356. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%debug
%code requires
{
typedef struct sem_type
{
int ival;
float fval;
} sem_type;
# include <cstdio> // EOF.
# include <iostream>
namespace
{
void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
}
}
%define api.value.type {sem_type}
%code
{
static int yylex (yy::parser::value_type *lvalp);
}
%token UNTYPED
%token <ival> INT
%type <fval> float
%printer { report (yyo, $$, $<fval>$); } <ival>;
%printer { report (yyo, $<ival>$, $$ ); } <fval>;
%printer { report (yyo, $<ival>$, $<fval>$); } <>;
%initial-action
{
$<ival>$ = 42;
$<fval>$ = 4.2f;
}
%%
float: UNTYPED INT
{
$$ = $<fval>1 + $<fval>2;
$<ival>$ = $<ival>1 + $2;
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
(*lvalp).ival = toknum * 10;
(*lvalp).fval = YY_CAST (float, toknum) / 10.0f;;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1856"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1856"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# Don't be too picky on the traces, GLR is not exactly the same. Keep
# only the lines from the printer.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -ne '/ival:/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Next token is token INT (ival: 20, fval: 0.2)
Shifting token INT (ival: 20, fval: 0.2)
\$1 = token UNTYPED (ival: 10, fval: 0.1)
\$2 = token INT (ival: 20, fval: 0.2)
-> \$\$ = nterm float (ival: 30, fval: 0.3)
Cleanup: popping nterm float (ival: 30, fval: 0.3)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_356
#AT_START_357
at_fn_group_banner 357 'actions.at:1856' \
"Qualified \$\$ in actions: glr.cc" " " 14
at_xfail=no
(
printf "%s\n" "357. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.cc"
%debug
%code requires
{
typedef struct sem_type
{
int ival;
float fval;
} sem_type;
# include <cstdio> // EOF.
# include <iostream>
namespace
{
void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
}
}
%define api.value.type {sem_type}
%code
{
static int yylex (yy::parser::value_type *lvalp);
}
%token UNTYPED
%token <ival> INT
%type <fval> float
%printer { report (yyo, $$, $<fval>$); } <ival>;
%printer { report (yyo, $<ival>$, $$ ); } <fval>;
%printer { report (yyo, $<ival>$, $<fval>$); } <>;
%initial-action
{
$<ival>$ = 42;
$<fval>$ = 4.2f;
}
%%
float: UNTYPED INT
{
$$ = $<fval>1 + $<fval>2;
$<ival>$ = $<ival>1 + $2;
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
(*lvalp).ival = toknum * 10;
(*lvalp).fval = YY_CAST (float, toknum) / 10.0f;;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1856"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1856"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# Don't be too picky on the traces, GLR is not exactly the same. Keep
# only the lines from the printer.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -ne '/ival:/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Next token is token INT (ival: 20, fval: 0.2)
Shifting token INT (ival: 20, fval: 0.2)
\$1 = token UNTYPED (ival: 10, fval: 0.1)
\$2 = token INT (ival: 20, fval: 0.2)
-> \$\$ = nterm float (ival: 30, fval: 0.3)
Cleanup: popping nterm float (ival: 30, fval: 0.3)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_357
#AT_START_358
at_fn_group_banner 358 'actions.at:1856' \
"Qualified \$\$ in actions: glr2.cc" " " 14
at_xfail=no
(
printf "%s\n" "358. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr2.cc"
%debug
%code requires
{
typedef struct sem_type
{
int ival;
float fval;
} sem_type;
# include <cstdio> // EOF.
# include <iostream>
namespace
{
void
report (std::ostream& yyo, int ival, float fval)
{
yyo << "ival: " << ival << ", fval: " << fval;
}
}
}
%define api.value.type {sem_type}
%code
{
static int yylex (yy::parser::value_type *lvalp);
}
%token UNTYPED
%token <ival> INT
%type <fval> float
%printer { report (yyo, $$, $<fval>$); } <ival>;
%printer { report (yyo, $<ival>$, $$ ); } <fval>;
%printer { report (yyo, $<ival>$, $<fval>$); } <>;
%initial-action
{
$<ival>$ = 42;
$<fval>$ = 4.2f;
}
%%
float: UNTYPED INT
{
$$ = $<fval>1 + $<fval>2;
$<ival>$ = $<ival>1 + $2;
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = {yy::parser::token::UNTYPED, yy::parser::token::INT, EOF};
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
(*lvalp).ival = toknum * 10;
(*lvalp).fval = YY_CAST (float, toknum) / 10.0f;;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1856"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
printf "%s\n" "actions.at:1856" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1856"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "actions.at:1856"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: \$PREPARSER ./input --debug"
at_fn_check_prepare_dynamic " $PREPARSER ./input --debug" "actions.at:1856"
( $at_check_trace; $PREPARSER ./input --debug
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
# Don't be too picky on the traces, GLR is not exactly the same. Keep
# only the lines from the printer.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1856: sed -ne '/ival:/p' stderr"
at_fn_check_prepare_trace "actions.at:1856"
( $at_check_trace; sed -ne '/ival:/p' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "Next token is token UNTYPED (ival: 10, fval: 0.1)
Shifting token UNTYPED (ival: 10, fval: 0.1)
Next token is token INT (ival: 20, fval: 0.2)
Shifting token INT (ival: 20, fval: 0.2)
\$1 = token UNTYPED (ival: 10, fval: 0.1)
\$2 = token INT (ival: 20, fval: 0.2)
-> \$\$ = nterm float (ival: 30, fval: 0.3)
Cleanup: popping nterm float (ival: 30, fval: 0.3)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1856"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_358
#AT_START_359
at_fn_group_banner 359 'actions.at:1863' \
"Destroying lookahead assigned by semantic action" "" 14
at_xfail=no
(
printf "%s\n" "359. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%code {
#include <assert.h>
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
#define USE(Var)
}
%destructor { fprintf (stderr, "'a' destructor\n"); } 'a'
%destructor { fprintf (stderr, "'b' destructor\n"); } 'b'
%%
// In a previous version of Bison, yychar assigned by the semantic
// action below was not translated into yytoken before the lookahead was
// discarded and thus before its destructor (selected according to
// yytoken) was called in order to return from yyparse. This would
// happen even if YYACCEPT was performed in a later semantic action as
// long as only consistent states with default reductions were visited
// in between. However, we leave YYACCEPT in the same semantic action
// for this test in order to show that skeletons cannot simply translate
// immediately after every semantic action because a semantic action
// that has set yychar might not always return normally. Instead,
// skeletons must translate before every use of yytoken.
start: 'a' accept { USE($1); } ;
accept: %empty {
assert (yychar == YYEMPTY);
yychar = 'b';
YYACCEPT;
} ;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "a";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
(void) argc;
(void) argv;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1905"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1905"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1905"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1905"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1905"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1905: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1905"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1905"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1906" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1906"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1906: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1906"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1906"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1907: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1907"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1907"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1907: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1907"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "'b' destructor
'a' destructor
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1907"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_359
#AT_START_360
at_fn_group_banner 360 'actions.at:1918' \
"YYBACKUP" " " 14
at_xfail=no
(
printf "%s\n" "360. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%define parse.error verbose
%debug
%define api.pure
%code {
# include <stdio.h>
# include <stdlib.h>
# include <assert.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (YYSTYPE *lvalp);
}
%%
input:
exp exp {}
;
exp:
'a' { printf ("a: %d\n", $1); }
| 'b' { YYBACKUP('a', 123); }
| 'c' 'd' { YYBACKUP('a', 456); }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (YYSTYPE *lvalp)
{
static char const input[] = "bcd";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
*lvalp = (toknum + 1) * 10;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "actions.at:1953"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "actions.at:1953"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1953"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "actions.at:1953"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "actions.at:1953"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1953: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "actions.at:1953"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1953"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "actions.at:1954" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/actions.at:1954"
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1954: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "actions.at:1954"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1954"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1955: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "actions.at:1955"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "a: 123
a: 456
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1955"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/actions.at:1955: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "actions.at:1955"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/actions.at:1955"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_360
#AT_START_361
at_fn_group_banner 361 'types.at:25' \
"%union vs. api.value.type" " " 15
at_xfail=no
(
printf "%s\n" "361. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%union { int ival; }
%define api.value.type union-directive
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/types.at:34: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:34"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-38: error: '%union' and '%define api.value.type' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/types.at:34"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_361
#AT_START_362
at_fn_group_banner 362 'types.at:44' \
"%yacc vs. api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "362. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%yacc
%define api.value.type union
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/types.at:53: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:53"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.1-28: error: '%yacc' and '%define api.value.type \"union\"' cannot be used together
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/types.at:53"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_362
#AT_START_363
at_fn_group_banner 363 'types.at:139' \
"yacc.c api.value.type={double}" " " 15
at_xfail=no
(
printf "%s\n" "363. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {double}
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_363
#AT_START_364
at_fn_group_banner 364 'types.at:139' \
"yacc.c api.value.type={double} %header" " " 15
at_xfail=no
(
printf "%s\n" "364. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {double} %header
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_364
#AT_START_365
at_fn_group_banner 365 'types.at:139' \
"yacc.c api.value.type={variant}" " " 15
at_xfail=no
(
printf "%s\n" "365. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {variant}
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_365
#AT_START_366
at_fn_group_banner 366 'types.at:139' \
"yacc.c api.value.type={variant} %header" " " 15
at_xfail=no
(
printf "%s\n" "366. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {variant} %header
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_366
#AT_START_367
at_fn_group_banner 367 'types.at:139' \
"yacc.c api.value.type={struct foo}" " " 15
at_xfail=no
(
printf "%s\n" "367. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {struct foo}
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).ival = (res - '0') * 10;
(yylval).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_367
#AT_START_368
at_fn_group_banner 368 'types.at:139' \
"yacc.c api.value.type={struct foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "368. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {struct foo} %header
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).ival = (res - '0') * 10;
(yylval).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_368
#AT_START_369
at_fn_group_banner 369 'types.at:139' \
"yacc.c api.value.type={struct bar}" " " 15
at_xfail=no
(
printf "%s\n" "369. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {struct bar}
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { fprintf (yyo, "%d", $$); } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up));
assert ((yylval).up);
(yylval).up->ival = res - '0';
}
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_369
#AT_START_370
at_fn_group_banner 370 'types.at:139' \
"yacc.c api.value.type={struct bar} %header" " " 15
at_xfail=no
(
printf "%s\n" "370. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {struct bar} %header
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { fprintf (yyo, "%d", $$); } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up));
assert ((yylval).up);
(yylval).up->ival = res - '0';
}
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_370
#AT_START_371
at_fn_group_banner 371 'types.at:139' \
"yacc.c api.value.type={union foo}" " " 15
at_xfail=no
(
printf "%s\n" "371. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {union foo}
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = .2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_371
#AT_START_372
at_fn_group_banner 372 'types.at:139' \
"yacc.c api.value.type={union foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "372. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type {union foo} %header
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = .2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_372
#AT_START_373
at_fn_group_banner 373 'types.at:139' \
"yacc.c %union { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "373. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_373
#AT_START_374
at_fn_group_banner 374 'types.at:139' \
"yacc.c %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "374. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_374
#AT_START_375
at_fn_group_banner 375 'types.at:139' \
"yacc.c %union foo { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "375. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%union foo { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_375
#AT_START_376
at_fn_group_banner 376 'types.at:139' \
"yacc.c %union foo { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "376. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%union foo { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_376
#AT_START_377
at_fn_group_banner 377 'types.at:139' \
"yacc.c api.value.union.name=foo; %union { float fval; int ival; };" "" 15
at_xfail=no
(
printf "%s\n" "377. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.union.name foo; %union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_377
#AT_START_378
at_fn_group_banner 378 'types.at:139' \
"yacc.c api.value.union.name=foo; %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "378. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.union.name foo; %union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_378
#AT_START_379
at_fn_group_banner 379 'types.at:139' \
"yacc.c api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "379. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type union
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { fprintf (yyo, "%d", $$); } <int>
%printer { fprintf (yyo, "%f", $$); } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(yylval).ONE = 10;
else if (res == 102)
(yylval).TWO = .2f;
else if (res == 103)
(yylval).THREE = 3.3f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_379
#AT_START_380
at_fn_group_banner 380 'types.at:139' \
"yacc.c api.value.type=union %header" " " 15
at_xfail=no
(
printf "%s\n" "380. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "yacc.c"
%define api.value.type union %header
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { fprintf (yyo, "%d", $$); } <int>
%printer { fprintf (yyo, "%f", $$); } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(yylval).ONE = 10;
else if (res == 102)
(yylval).TWO = .2f;
else if (res == 103)
(yylval).THREE = 3.3f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_380
#AT_START_381
at_fn_group_banner 381 'types.at:139' \
"glr.c api.value.type={double}" " " 15
at_xfail=no
(
printf "%s\n" "381. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {double}
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_381
#AT_START_382
at_fn_group_banner 382 'types.at:139' \
"glr.c api.value.type={double} %header" " " 15
at_xfail=no
(
printf "%s\n" "382. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {double} %header
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_382
#AT_START_383
at_fn_group_banner 383 'types.at:139' \
"glr.c api.value.type={variant}" " " 15
at_xfail=no
(
printf "%s\n" "383. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {variant}
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_383
#AT_START_384
at_fn_group_banner 384 'types.at:139' \
"glr.c api.value.type={variant} %header" " " 15
at_xfail=no
(
printf "%s\n" "384. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {variant} %header
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(yylval) = (res - '0') / 10.0;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_384
#AT_START_385
at_fn_group_banner 385 'types.at:139' \
"glr.c api.value.type={struct foo}" " " 15
at_xfail=no
(
printf "%s\n" "385. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {struct foo}
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).ival = (res - '0') * 10;
(yylval).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_385
#AT_START_386
at_fn_group_banner 386 'types.at:139' \
"glr.c api.value.type={struct foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "386. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {struct foo} %header
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).ival = (res - '0') * 10;
(yylval).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_386
#AT_START_387
at_fn_group_banner 387 'types.at:139' \
"glr.c api.value.type={struct bar}" " " 15
at_xfail=no
(
printf "%s\n" "387. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {struct bar}
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { fprintf (yyo, "%d", $$); } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up));
assert ((yylval).up);
(yylval).up->ival = res - '0';
}
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_387
#AT_START_388
at_fn_group_banner 388 'types.at:139' \
"glr.c api.value.type={struct bar} %header" " " 15
at_xfail=no
(
printf "%s\n" "388. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {struct bar} %header
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { fprintf (yyo, "%d", $$); } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(yylval).up = YY_CAST (struct u *, malloc (sizeof *(yylval).up));
assert ((yylval).up);
(yylval).up->ival = res - '0';
}
;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_388
#AT_START_389
at_fn_group_banner 389 'types.at:139' \
"glr.c api.value.type={union foo}" " " 15
at_xfail=no
(
printf "%s\n" "389. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {union foo}
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = .2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_389
#AT_START_390
at_fn_group_banner 390 'types.at:139' \
"glr.c api.value.type={union foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "390. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type {union foo} %header
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = .2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_390
#AT_START_391
at_fn_group_banner 391 'types.at:139' \
"glr.c %union { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "391. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_391
#AT_START_392
at_fn_group_banner 392 'types.at:139' \
"glr.c %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "392. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_392
#AT_START_393
at_fn_group_banner 393 'types.at:139' \
"glr.c %union foo { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "393. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%union foo { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_393
#AT_START_394
at_fn_group_banner 394 'types.at:139' \
"glr.c %union foo { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "394. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%union foo { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_394
#AT_START_395
at_fn_group_banner 395 'types.at:139' \
"glr.c api.value.union.name=foo; %union { float fval; int ival; };" "" 15
at_xfail=no
(
printf "%s\n" "395. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.union.name foo; %union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_395
#AT_START_396
at_fn_group_banner 396 'types.at:139' \
"glr.c api.value.union.name=foo; %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "396. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.union.name foo; %union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(yylval).ival = 10;
else if (res == '2')
(yylval).fval = 0.2f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_396
#AT_START_397
at_fn_group_banner 397 'types.at:139' \
"glr.c api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "397. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type union
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { fprintf (yyo, "%d", $$); } <int>
%printer { fprintf (yyo, "%f", $$); } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(yylval).ONE = 10;
else if (res == 102)
(yylval).TWO = .2f;
else if (res == 103)
(yylval).THREE = 3.3f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_397
#AT_START_398
at_fn_group_banner 398 'types.at:139' \
"glr.c api.value.type=union %header" " " 15
at_xfail=no
(
printf "%s\n" "398. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%skeleton "glr.c"
%define api.value.type union %header
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { fprintf (yyo, "%d", $$); } <int>
%printer { fprintf (yyo, "%f", $$); } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <assert.h>
static
int yylex (void)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(yylval).ONE = 10;
else if (res == 102)
(yylval).TWO = .2f;
else if (res == 103)
(yylval).THREE = 3.3f;
return res;
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.c test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.c test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o test test.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS" "types.at:139"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o test test.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_398
#AT_START_399
at_fn_group_banner 399 'types.at:139' \
"lalr1.cc api.value.type={double}" " " 15
at_xfail=no
(
printf "%s\n" "399. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {double}
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_399
#AT_START_400
at_fn_group_banner 400 'types.at:139' \
"lalr1.cc api.value.type={double} %header" " " 15
at_xfail=no
(
printf "%s\n" "400. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {double} %header
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_400
#AT_START_401
at_fn_group_banner 401 'types.at:139' \
"lalr1.cc api.value.type={variant}" " " 15
at_xfail=no
(
printf "%s\n" "401. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {variant}
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_401
#AT_START_402
at_fn_group_banner 402 'types.at:139' \
"lalr1.cc api.value.type={variant} %header" " " 15
at_xfail=no
(
printf "%s\n" "402. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {variant} %header
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_402
#AT_START_403
at_fn_group_banner 403 'types.at:139' \
"lalr1.cc api.value.type={struct foo}" " " 15
at_xfail=no
(
printf "%s\n" "403. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {struct foo}
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_403
#AT_START_404
at_fn_group_banner 404 'types.at:139' \
"lalr1.cc api.value.type={struct foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "404. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {struct foo} %header
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_404
#AT_START_405
at_fn_group_banner 405 'types.at:139' \
"lalr1.cc api.value.type={struct bar}" " " 15
at_xfail=no
(
printf "%s\n" "405. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {struct bar}
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_405
#AT_START_406
at_fn_group_banner 406 'types.at:139' \
"lalr1.cc api.value.type={struct bar} %header" " " 15
at_xfail=no
(
printf "%s\n" "406. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {struct bar} %header
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_406
#AT_START_407
at_fn_group_banner 407 'types.at:139' \
"lalr1.cc api.value.type={union foo}" " " 15
at_xfail=no
(
printf "%s\n" "407. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {union foo}
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_407
#AT_START_408
at_fn_group_banner 408 'types.at:139' \
"lalr1.cc api.value.type={union foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "408. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type {union foo} %header
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_408
#AT_START_409
at_fn_group_banner 409 'types.at:139' \
"lalr1.cc %union { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "409. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_409
#AT_START_410
at_fn_group_banner 410 'types.at:139' \
"lalr1.cc %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "410. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_410
#AT_START_411
at_fn_group_banner 411 'types.at:139' \
"lalr1.cc api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "411. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type union
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_411
#AT_START_412
at_fn_group_banner 412 'types.at:139' \
"lalr1.cc api.value.type=union %header" " " 15
at_xfail=no
(
printf "%s\n" "412. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type union %header
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_412
#AT_START_413
at_fn_group_banner 413 'types.at:139' \
"lalr1.cc api.value.type=variant" " " 15
at_xfail=no
(
printf "%s\n" "413. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type variant
%token <int> '1';
%token <std::string> '2';
%%
start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).build (10);
else if (res == '2')
(*lvalp).build<std::string> ("two");;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, two
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_413
#AT_START_414
at_fn_group_banner 414 'types.at:139' \
"lalr1.cc api.value.type=variant %header" " " 15
at_xfail=no
(
printf "%s\n" "414. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type variant %header
%token <int> '1';
%token <std::string> '2';
%%
start: '1' '2' { std::cout << $1 << ", " << $2 << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).build (10);
else if (res == '2')
(*lvalp).build<std::string> ("two");;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, two
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_414
#AT_START_415
at_fn_group_banner 415 'types.at:139' \
"lalr1.cc api.value.type=variant" " " 15
at_xfail=no
(
printf "%s\n" "415. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type variant
%token <std::pair<int, int>> '1';
%token <std::pair<std::string, std::string>> '2';
%%
start: '1' '2'
{
std::cout << $1.first << ':' << $1.second << ", "
<< $2.first << ':' << $2.second << '\n';
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).build (std::make_pair (10, 11));
else if (res == '2')
(*lvalp).build (std::pair<std::string, std::string> ("two", "deux"));;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10:11, two:deux
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_415
#AT_START_416
at_fn_group_banner 416 'types.at:139' \
"lalr1.cc api.value.type=variant %header" " " 15
at_xfail=no
(
printf "%s\n" "416. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%define api.value.type variant %header
%token <std::pair<int, int>> '1';
%token <std::pair<std::string, std::string>> '2';
%%
start: '1' '2'
{
std::cout << $1.first << ':' << $1.second << ", "
<< $2.first << ':' << $2.second << '\n';
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).build (std::make_pair (10, 11));
else if (res == '2')
(*lvalp).build (std::pair<std::string, std::string> ("two", "deux"));;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10:11, two:deux
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_416
#AT_START_417
at_fn_group_banner 417 'types.at:139' \
"lalr1.cc api.value.type=variant api.token.constructor" "" 15
at_xfail=no
(
printf "%s\n" "417. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%define api.value.type variant
%define api.token.constructor
%token <std::pair<int, int>> '1' '2';
%%
start: '1' '2'
{
std::cout << $1.first << ':' << $1.second << ", "
<< $2.first << ':' << $2.second << '\n';
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
typedef yy::parser::symbol_type symbol;
if (res)
return symbol (res, std::make_pair (res - '0', res - '0' + 1));
else
return symbol (res);
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1:2, 2:3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_417
#AT_START_418
at_fn_group_banner 418 'types.at:139' \
"lalr1.cc api.value.type=variant api.token.constructor %header" "" 15
at_xfail=no
(
printf "%s\n" "418. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%define api.value.type variant
%define api.token.constructor %header
%token <std::pair<int, int>> '1' '2';
%%
start: '1' '2'
{
std::cout << $1.first << ':' << $1.second << ", "
<< $2.first << ':' << $2.second << '\n';
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
typedef yy::parser::symbol_type symbol;
if (res)
return symbol (res, std::make_pair (res - '0', res - '0' + 1));
else
return symbol (res);
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1:2, 2:3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_418
#AT_START_419
at_fn_group_banner 419 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant" "" 15
at_xfail=no
(
printf "%s\n" "419. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant
%token <std::unique_ptr<int>> '1';
%token <std::pair<int, int>> '2';
%%
start: '1' '2' { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).emplace <std::unique_ptr<int>>
(std::make_unique <int> (10));
else if (res == '2')
(*lvalp).emplace <std::pair<int, int>> (21, 22);;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_419
#AT_START_420
at_fn_group_banner 420 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant %header" "" 15
at_xfail=no
(
printf "%s\n" "420. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant %header
%token <std::unique_ptr<int>> '1';
%token <std::pair<int, int>> '2';
%%
start: '1' '2' { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).emplace <std::unique_ptr<int>>
(std::make_unique <int> (10));
else if (res == '2')
(*lvalp).emplace <std::pair<int, int>> (21, 22);;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_420
#AT_START_421
at_fn_group_banner 421 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor" "" 15
at_xfail=no
(
printf "%s\n" "421. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant
%define api.token.constructor
%token <std::unique_ptr<int>> ONE;
%token <std::pair<int, int>> TWO;
%token EOI 0;
%%
start: ONE TWO { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
return yy::parser::make_ONE (std::make_unique<int> (10));
else if (res == '2')
return yy::parser::make_TWO (std::make_pair (21, 22));
else
return yy::parser::make_EOI ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_421
#AT_START_422
at_fn_group_banner 422 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor %header" "" 15
at_xfail=no
(
printf "%s\n" "422. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant
%define api.token.constructor %header
%token <std::unique_ptr<int>> ONE;
%token <std::pair<int, int>> TWO;
%token EOI 0;
%%
start: ONE TWO { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
return yy::parser::make_ONE (std::make_unique<int> (10));
else if (res == '2')
return yy::parser::make_TWO (std::make_pair (21, 22));
else
return yy::parser::make_EOI ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_422
#AT_START_423
at_fn_group_banner 423 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor" "" 15
at_xfail=no
(
printf "%s\n" "423. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant
%define api.token.constructor
%token <std::unique_ptr<int>> '1';
%token <std::pair<int, int>> '2';
%%
start: '1' '2' { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
return {res, std::make_unique<int> (10)};
else if (res == '2')
return {res, std::make_pair (21, 22)};
else
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_423
#AT_START_424
at_fn_group_banner 424 'types.at:139' \
"lalr1.cc %code requires { #include <memory> } api.value.type=variant api.token.constructor %header" "" 15
at_xfail=no
(
printf "%s\n" "424. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static yy::parser::symbol_type yylex ();
}
%skeleton "lalr1.cc"
%code requires { #include <memory> }
%define api.value.type variant
%define api.token.constructor %header
%token <std::unique_ptr<int>> '1';
%token <std::pair<int, int>> '2';
%%
start: '1' '2' { std::cout << *$1 << ", "
<< $2.first << ':' << $2.second << '\n'; };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
yy::parser::symbol_type yylex ()
{
static char const input[] = "12";
static int toknum = 0;
int res;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
return {res, std::make_unique<int> (10)};
else if (res == '2')
return {res, std::make_pair (21, 22)};
else
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201402
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10, 21:22
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_424
#AT_START_425
at_fn_group_banner 425 'types.at:139' \
"glr.cc api.value.type={double}" " " 15
at_xfail=no
(
printf "%s\n" "425. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {double}
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_425
#AT_START_426
at_fn_group_banner 426 'types.at:139' \
"glr.cc api.value.type={double} %header" " " 15
at_xfail=no
(
printf "%s\n" "426. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {double} %header
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_426
#AT_START_427
at_fn_group_banner 427 'types.at:139' \
"glr.cc api.value.type={variant}" " " 15
at_xfail=no
(
printf "%s\n" "427. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {variant}
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_427
#AT_START_428
at_fn_group_banner 428 'types.at:139' \
"glr.cc api.value.type={variant} %header" " " 15
at_xfail=no
(
printf "%s\n" "428. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {variant} %header
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_428
#AT_START_429
at_fn_group_banner 429 'types.at:139' \
"glr.cc api.value.type={struct foo}" " " 15
at_xfail=no
(
printf "%s\n" "429. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {struct foo}
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_429
#AT_START_430
at_fn_group_banner 430 'types.at:139' \
"glr.cc api.value.type={struct foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "430. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {struct foo} %header
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_430
#AT_START_431
at_fn_group_banner 431 'types.at:139' \
"glr.cc api.value.type={struct bar}" " " 15
at_xfail=no
(
printf "%s\n" "431. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {struct bar}
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_431
#AT_START_432
at_fn_group_banner 432 'types.at:139' \
"glr.cc api.value.type={struct bar} %header" " " 15
at_xfail=no
(
printf "%s\n" "432. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {struct bar} %header
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_432
#AT_START_433
at_fn_group_banner 433 'types.at:139' \
"glr.cc api.value.type={union foo}" " " 15
at_xfail=no
(
printf "%s\n" "433. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {union foo}
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_433
#AT_START_434
at_fn_group_banner 434 'types.at:139' \
"glr.cc api.value.type={union foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "434. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type {union foo} %header
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_434
#AT_START_435
at_fn_group_banner 435 'types.at:139' \
"glr.cc %union { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "435. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_435
#AT_START_436
at_fn_group_banner 436 'types.at:139' \
"glr.cc %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "436. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_436
#AT_START_437
at_fn_group_banner 437 'types.at:139' \
"glr.cc api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "437. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type union
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_437
#AT_START_438
at_fn_group_banner 438 'types.at:139' \
"glr.cc api.value.type=union %header" " " 15
at_xfail=no
(
printf "%s\n" "438. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr.cc"
%define api.value.type union %header
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_438
#AT_START_439
at_fn_group_banner 439 'types.at:139' \
"glr2.cc api.value.type={double}" " " 15
at_xfail=no
(
printf "%s\n" "439. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {double}
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_439
#AT_START_440
at_fn_group_banner 440 'types.at:139' \
"glr2.cc api.value.type={double} %header" " " 15
at_xfail=no
(
printf "%s\n" "440. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {double} %header
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_440
#AT_START_441
at_fn_group_banner 441 'types.at:139' \
"glr2.cc api.value.type={variant}" " " 15
at_xfail=no
(
printf "%s\n" "441. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {variant}
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_441
#AT_START_442
at_fn_group_banner 442 'types.at:139' \
"glr2.cc api.value.type={variant} %header" " " 15
at_xfail=no
(
printf "%s\n" "442. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {variant} %header
%code requires { typedef double variant; }
%%
start: '1' '2' { printf ("%2.1f\n", $1 + $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
(*lvalp) = (res - '0') / 10.0;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_442
#AT_START_443
at_fn_group_banner 443 'types.at:139' \
"glr2.cc api.value.type={struct foo}" " " 15
at_xfail=no
(
printf "%s\n" "443. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {struct foo}
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_443
#AT_START_444
at_fn_group_banner 444 'types.at:139' \
"glr2.cc api.value.type={struct foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "444. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {struct foo} %header
%code requires { struct foo { float fval; int ival; }; }
%%
start: '1' '2'
{ printf ("%d %2.1f\n", $1.ival + $2.ival, $1.fval + $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).ival = (res - '0') * 10;
(*lvalp).fval = YY_CAST (float, res - '0') / 10.f;
};
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "30 0.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_444
#AT_START_445
at_fn_group_banner 445 'types.at:139' \
"glr2.cc api.value.type={struct bar}" " " 15
at_xfail=no
(
printf "%s\n" "445. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {struct bar}
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_445
#AT_START_446
at_fn_group_banner 446 'types.at:139' \
"glr2.cc api.value.type={struct bar} %header" " " 15
at_xfail=no
(
printf "%s\n" "446. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {struct bar} %header
%code requires
{
struct u
{
int ival;
};
struct bar
{
struct u *up;
};
}
%token <up->ival> '1' '2'
%printer { yyo << $$; } <up->ival>
%%
start: '1' '2'
{
printf ("%d %d\n", $1, $<up->ival>2);
free ($<up>1);
free ($<up>2);
};
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res)
{
(*lvalp).up = YY_CAST (struct u *, malloc (sizeof *(*lvalp).up));
assert ((*lvalp).up);
(*lvalp).up->ival = res - '0';
}
;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "1 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_446
#AT_START_447
at_fn_group_banner 447 'types.at:139' \
"glr2.cc api.value.type={union foo}" " " 15
at_xfail=no
(
printf "%s\n" "447. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {union foo}
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_447
#AT_START_448
at_fn_group_banner 448 'types.at:139' \
"glr2.cc api.value.type={union foo} %header" " " 15
at_xfail=no
(
printf "%s\n" "448. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type {union foo} %header
%code requires { union foo { float fval; int ival; }; }
%%
start: '1' '2' { printf ("%d %2.1f\n", $1.ival, $2.fval); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = .2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_448
#AT_START_449
at_fn_group_banner 449 'types.at:139' \
"glr2.cc %union { float fval; int ival; };" " " 15
at_xfail=no
(
printf "%s\n" "449. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%union { float fval; int ival; };
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_449
#AT_START_450
at_fn_group_banner 450 'types.at:139' \
"glr2.cc %union { float fval; int ival; }; %header" "" 15
at_xfail=no
(
printf "%s\n" "450. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%union { float fval; int ival; }; %header
%token <ival> '1';
%token <fval> '2';
%%
start: '1' '2' { printf ("%d %2.1f\n", $1, $2); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static char const input[] = "12";
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == '1')
(*lvalp).ival = 10;
else if (res == '2')
(*lvalp).fval = 0.2f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_450
#AT_START_451
at_fn_group_banner 451 'types.at:139' \
"glr2.cc api.value.type=union" " " 15
at_xfail=no
(
printf "%s\n" "451. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type union
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_451
#AT_START_452
at_fn_group_banner 452 'types.at:139' \
"glr2.cc api.value.type=union %header" " " 15
at_xfail=no
(
printf "%s\n" "452. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >test.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%debug
%code
{
# include <stdio.h>
# include <stdlib.h>
static int yylex (yy::parser::value_type *lvalp);
}
%skeleton "glr2.cc"
%define api.value.type union %header
%token <int> ONE 101;
%token <float> TWO 102 THREE 103;
%printer { yyo << $$; } <int>
%printer { yyo << $$; } <float>
%%
start: ONE TWO THREE { printf ("%d %2.1f %2.1f\n", $1, $2, $3); };
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <assert.h>
static
int yylex (yy::parser::value_type *lvalp)
{
static int const input[] = { 101, 102, 103, EOF };
static int toknum = 0;
int res;
(void) lvalp;
enum { input_elts = sizeof input / sizeof input[0] };
(void) input_elts;
assert (0 <= toknum && toknum < input_elts);
res = input[toknum++];
if (res == 101)
(*lvalp).ONE = 10;
else if (res == 102)
(*lvalp).TWO = .2f;
else if (res == 103)
(*lvalp).THREE = 3.3f;
return res;
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
at_for_each_std_CXXFLAGS_save=$CXXFLAGS
for at_std in '' \
${CXX98_CXXFLAGS:+"$CXX98_CXXFLAGS"} \
${CXX03_CXXFLAGS:+"$CXX03_CXXFLAGS"} \
${CXX11_CXXFLAGS:+"$CXX11_CXXFLAGS"} \
${CXX14_CXXFLAGS:+"$CXX14_CXXFLAGS"} \
${CXX17_CXXFLAGS:+"$CXX17_CXXFLAGS"} \
${CXX20_CXXFLAGS:+"$CXX20_CXXFLAGS"} \
${CXX2B_CXXFLAGS:+"$CXX2B_CXXFLAGS"}
do
printf "%s\n" "======== Testing with C++ standard flags: '$at_cxx_std'"
CXXFLAGS="$at_for_each_std_CXXFLAGS_save $at_std"
cat >check.cc <<'_ATEOF'
int main ()
{
#if !defined __cplusplus || __cplusplus < 201103
return 1;
#else
return 0;
#endif
}
_ATEOF
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o check check.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o check check.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: ./check"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; ./check
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
if test $at_status != 0; then
echo "$at_std not supported"; continue
fi
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o test.cc test.y"
at_fn_check_prepare_notrace 'an embedded newline' "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y" "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "types.at:139"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o test.cc test.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "types.at:139" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
printf "%s\n" "types.at:139" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/types.at:139"
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o test test.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS" "types.at:139"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o test test.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: \$PREPARSER ./test"
at_fn_check_prepare_dynamic " $PREPARSER ./test" "types.at:139"
( $at_check_trace; $PREPARSER ./test
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "10 0.2 3.3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/types.at:139: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "types.at:139"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/types.at:139"
$at_failed && at_fn_log_failure
$at_traceon; }
done
CXXFLAGS=$at_for_each_std_CXXFLAGS_save
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_452
#AT_START_453
at_fn_group_banner 453 'types.at:377' \
"lalr1.cc: Named %union" " " 15
at_xfail=no
(
printf "%s\n" "453. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.cc"
%union foo { float fval; int ival; };
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/types.at:377: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:377"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: error: named %union is invalid in C++
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/types.at:377"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_453
#AT_START_454
at_fn_group_banner 454 'types.at:377' \
"glr.cc: Named %union" " " 15
at_xfail=no
(
printf "%s\n" "454. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "glr.cc"
%union foo { float fval; int ival; };
%%
exp: %empty;
_ATEOF
{ set +x
printf "%s\n" "$at_srcdir/types.at:377: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y" "types.at:377"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo >>"$at_stderr"; printf "%s\n" "input.y:2.8-10: error: named %union is invalid in C++
" | \
$at_diff - "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/types.at:377"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_454
#AT_START_455
at_fn_group_banner 455 'scanner.at:326' \
"Token numbers: yacc.c" " " 16
at_xfail=no
(
printf "%s\n" "455. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c"
%debug
%code
{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* abort */
int yylex (void)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(yylval).val = c - '0';
return NUM;
case '+': return PLUS;
case '-': return MINUS;
case '*': return STAR;
case '/': return SLASH;
case '(': return LPAR;
case ')': return RPAR;
case 0: return 0;
}
abort ();
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:326"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_455
#AT_START_456
at_fn_group_banner 456 'scanner.at:326' \
"Token numbers: yacc.c api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "456. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "yacc.c" %define api.token.raw
%debug
%code
{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* abort */
int yylex (void)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(yylval).val = c - '0';
return NUM;
case '+': return PLUS;
case '-': return MINUS;
case '*': return STAR;
case '/': return SLASH;
case '(': return LPAR;
case ')': return RPAR;
case 0: return 0;
}
abort ();
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:326"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_456
#AT_START_457
at_fn_group_banner 457 'scanner.at:326' \
"Token numbers: glr.c" " " 16
at_xfail=no
(
printf "%s\n" "457. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.c"
%debug
%code
{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* abort */
int yylex (void)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(yylval).val = c - '0';
return NUM;
case '+': return PLUS;
case '-': return MINUS;
case '*': return STAR;
case '/': return SLASH;
case '(': return LPAR;
case ')': return RPAR;
case 0: return 0;
}
abort ();
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:326"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_457
#AT_START_458
at_fn_group_banner 458 'scanner.at:326' \
"Token numbers: glr.c api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "458. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.c" %define api.token.raw
%debug
%code
{
#include <stdio.h>
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
static int yylex (void);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <stdlib.h> /* abort */
int yylex (void)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(yylval).val = c - '0';
return NUM;
case '+': return PLUS;
case '-': return MINUS;
case '*': return STAR;
case '/': return SLASH;
case '(': return LPAR;
case ')': return RPAR;
case 0: return 0;
}
abort ();
}
#include <stdlib.h> /* getenv. */
#include <string.h> /* strcmp. */
int
main (int argc, char const* argv[])
{
yydebug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
yydebug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
yydebug |= 2;
return yyparse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.c input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.c input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o input input.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS" "scanner.at:326"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o input input.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.c"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_458
#AT_START_459
at_fn_group_banner 459 'scanner.at:326' \
"Token numbers: lalr1.cc" " " 16
at_xfail=no
(
printf "%s\n" "459. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc"
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_459
#AT_START_460
at_fn_group_banner 460 'scanner.at:326' \
"Token numbers: lalr1.cc api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "460. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc" %define api.token.raw
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_460
#AT_START_461
at_fn_group_banner 461 'scanner.at:326' \
"Token numbers: glr.cc" " " 16
at_xfail=no
(
printf "%s\n" "461. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.cc"
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_461
#AT_START_462
at_fn_group_banner 462 'scanner.at:326' \
"Token numbers: glr.cc api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "462. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr.cc" %define api.token.raw
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_462
#AT_START_463
at_fn_group_banner 463 'scanner.at:326' \
"Token numbers: glr2.cc" " " 16
at_xfail=no
(
printf "%s\n" "463. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr2.cc"
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_463
#AT_START_464
at_fn_group_banner 464 'scanner.at:326' \
"Token numbers: glr2.cc api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "464. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "glr2.cc" %define api.token.raw
%debug
%code
{
#include <stdio.h>
static int yylex (yy::parser::value_type *lvalp);
}
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
int yylex (yy::parser::value_type *lvalp)
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
(*lvalp).val = c - '0';
return yy::parser::token::NUM;
case '+': return yy::parser::token::PLUS;
case '-': return yy::parser::token::MINUS;
case '*': return yy::parser::token::STAR;
case '/': return yy::parser::token::SLASH;
case '(': return yy::parser::token::LPAR;
case ')': return yy::parser::token::RPAR;
case 0: return yy::parser::token::END;
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test x"$CXX11_CXXFLAGS" == x) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$CXX \$CPPFLAGS \$CXX11_CXXFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:326"
( $at_check_trace; $CXX $CPPFLAGS $CXX11_CXXFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_464
#AT_START_465
at_fn_group_banner 465 'scanner.at:326' \
"Token numbers: lalr1.d" " " 16
at_xfail=no
(
printf "%s\n" "465. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.d"
%debug
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* An error reporting function. */
public void yyerror (string m)
{
stderr.writeln (m);
}
import std.range.primitives;
import std.stdio;
auto yyLexer(R)(R range)
if (isInputRange!R && is (ElementType!R : dchar))
{
return new YYLexer!R(range);
}
auto yyLexer ()
{
return yyLexer("0-(1+2)*3/9");
}
class YYLexer(R) : Lexer
if (isInputRange!R && is (ElementType!R : dchar))
{
R input;
this(R r) { input = r; }
/* An error reporting function. */
public void yyerror (string m)
{
stderr.writeln (m);
}
Symbol yylex ()
{
import std.uni : isNumber;
// Handle EOF.
if (input.empty)
return Symbol(TokenKind.END);
auto c = input.front;
input.popFront;
// Numbers.
switch (c)
{
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
return Symbol(TokenKind.NUM, c - '0');
case '+': return Symbol(TokenKind.PLUS);
case '-': return Symbol(TokenKind.MINUS);
case '*': return Symbol(TokenKind.STAR);
case '/': return Symbol(TokenKind.SLASH);
case '(': return Symbol(TokenKind.LPAR);
case ')': return Symbol(TokenKind.RPAR);
default: assert(0);
}
}
}
int main ()
{
auto l = yyLexer ();
auto p = new YYParser (l);
return !p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.d input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_DC_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$DC \$DCFLAGS -ofinput input.d"
at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofinput input.d" "scanner.at:326"
( $at_check_trace; $DC $DCFLAGS -ofinput input.d
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.d"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.d
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_465
#AT_START_466
at_fn_group_banner 466 'scanner.at:326' \
"Token numbers: lalr1.d api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "466. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.d" %define api.token.raw
%debug
%union {
int val;
}
%token <val> NUM "number"
%nterm <val> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* An error reporting function. */
public void yyerror (string m)
{
stderr.writeln (m);
}
import std.range.primitives;
import std.stdio;
auto yyLexer(R)(R range)
if (isInputRange!R && is (ElementType!R : dchar))
{
return new YYLexer!R(range);
}
auto yyLexer ()
{
return yyLexer("0-(1+2)*3/9");
}
class YYLexer(R) : Lexer
if (isInputRange!R && is (ElementType!R : dchar))
{
R input;
this(R r) { input = r; }
/* An error reporting function. */
public void yyerror (string m)
{
stderr.writeln (m);
}
Symbol yylex ()
{
import std.uni : isNumber;
// Handle EOF.
if (input.empty)
return Symbol(TokenKind.END);
auto c = input.front;
input.popFront;
// Numbers.
switch (c)
{
case '0', '1', '2', '3', '4', '5', '6', '7', '8', '9':
return Symbol(TokenKind.NUM, c - '0');
case '+': return Symbol(TokenKind.PLUS);
case '-': return Symbol(TokenKind.MINUS);
case '*': return Symbol(TokenKind.STAR);
case '/': return Symbol(TokenKind.SLASH);
case '(': return Symbol(TokenKind.LPAR);
case ')': return Symbol(TokenKind.RPAR);
default: assert(0);
}
}
}
int main ()
{
auto l = yyLexer ();
auto p = new YYParser (l);
return !p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.d input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.d input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.d input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(! $BISON_DC_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$DC \$DCFLAGS -ofinput input.d"
at_fn_check_prepare_dynamic "$DC $DCFLAGS -ofinput input.d" "scanner.at:326"
( $at_check_trace; $DC $DCFLAGS -ofinput input.d
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.d"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.d
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:326"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_466
#AT_START_467
at_fn_group_banner 467 'scanner.at:326' \
"Token numbers: lalr1.java" " " 16
at_xfail=no
(
printf "%s\n" "467. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.java"
%debug
%define api.prefix {Calc}
%define api.parser.class {Calc}
%code imports {
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.Reader;
import java.io.StreamTokenizer;
}
%token <Integer> NUM "number"
%type <Integer> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { System.out.println ($1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
class CalcLexer implements Calc.Lexer {
StreamTokenizer st;
public CalcLexer(InputStream is) {
st = new StreamTokenizer(new StringReader("0-(1+2)*3/9"));
st.resetSyntax();
st.eolIsSignificant(true);
st.whitespaceChars('\t', '\t');
st.whitespaceChars(' ', ' ');
st.wordChars('0', '9');
}
public void yyerror(String s) {
System.err.println(s);
}
Integer yylval;
public Object getLVal() {
return yylval;
}
public int yylex() throws IOException {
int ttype = st.nextToken();
switch (ttype)
{
case StreamTokenizer.TT_EOF:
return EOF;
case StreamTokenizer.TT_EOL:
return (int) '\n';
case StreamTokenizer.TT_WORD:
yylval = Integer.parseInt(st.sval);
return NUM;
case '+':
return PLUS;
case '-':
return MINUS;
case '*':
return STAR;
case '/':
return SLASH;
case '(':
return LPAR;
case ')':
return RPAR;
default:
throw new AssertionError("invalid character: " + ttype);
}
}
}
class input
{
public static void main (String[] args) throws IOException
{
CalcLexer l = new CalcLexer (System.in);
Calc p = new Calc (l);
//p.setDebugLevel (1);
boolean success = p.parse ();
if (!success)
System.exit (1);
}
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$SHELL ../../../javacomp.sh input.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "scanner.at:326"
( $at_check_trace; $SHELL ../../../javacomp.sh input.java
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.java"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.java
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$SHELL ../../../javaexec.sh input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "scanner.at:326"
( $at_check_trace; $SHELL ../../../javaexec.sh input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_467
#AT_START_468
at_fn_group_banner 468 'scanner.at:326' \
"Token numbers: lalr1.java api.token.raw" " " 16
at_xfail=no
(
printf "%s\n" "468. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%skeleton "lalr1.java" %define api.token.raw
%debug
%define api.prefix {Calc}
%define api.parser.class {Calc}
%code imports {
import java.io.IOException;
import java.io.InputStream;
import java.io.StringReader;
import java.io.Reader;
import java.io.StreamTokenizer;
}
%token <Integer> NUM "number"
%type <Integer> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { System.out.println ($1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
class CalcLexer implements Calc.Lexer {
StreamTokenizer st;
public CalcLexer(InputStream is) {
st = new StreamTokenizer(new StringReader("0-(1+2)*3/9"));
st.resetSyntax();
st.eolIsSignificant(true);
st.whitespaceChars('\t', '\t');
st.whitespaceChars(' ', ' ');
st.wordChars('0', '9');
}
public void yyerror(String s) {
System.err.println(s);
}
Integer yylval;
public Object getLVal() {
return yylval;
}
public int yylex() throws IOException {
int ttype = st.nextToken();
switch (ttype)
{
case StreamTokenizer.TT_EOF:
return EOF;
case StreamTokenizer.TT_EOL:
return (int) '\n';
case StreamTokenizer.TT_WORD:
yylval = Integer.parseInt(st.sval);
return NUM;
case '+':
return PLUS;
case '-':
return MINUS;
case '*':
return STAR;
case '/':
return SLASH;
case '(':
return LPAR;
case ')':
return RPAR;
default:
throw new AssertionError("invalid character: " + ttype);
}
}
}
class input
{
public static void main (String[] args) throws IOException
{
CalcLexer l = new CalcLexer (System.in);
Calc p = new Calc (l);
//p.setDebugLevel (1);
boolean success = p.parse ();
if (!success)
System.exit (1);
}
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.java input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y" "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:326"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y"
at_fn_check_prepare_trace "scanner.at:326"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.java input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test -z "$CONF_JAVAC") \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
printf "%s\n" "scanner.at:326" >"$at_check_line_file"
(test -z "$CONF_JAVA") \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:326"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$SHELL ../../../javacomp.sh input.java"
at_fn_check_prepare_dynamic "$SHELL ../../../javacomp.sh input.java" "scanner.at:326"
( $at_check_trace; $SHELL ../../../javacomp.sh input.java
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.java"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:326"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.java
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:326: \$SHELL ../../../javaexec.sh input"
at_fn_check_prepare_dynamic " $SHELL ../../../javaexec.sh input" "scanner.at:326"
( $at_check_trace; $SHELL ../../../javaexec.sh input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:326"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_468
#AT_START_469
at_fn_group_banner 469 'scanner.at:330' \
"Token numbers: lalr1.cc api.token.raw api.value.type=variant api.token.constructor" "" 16
at_xfail=no
(
printf "%s\n" "469. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >input.y <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
%skeleton "lalr1.cc" %define api.token.raw %define api.value.type variant %define api.token.constructor
%debug
%code
{
#include <stdio.h>
static yy::parser::symbol_type yylex ();
}
%token <int> NUM "number"
%nterm <int> exp
%token
PLUS "+"
MINUS "-"
STAR "*"
SLASH "/"
LPAR "("
RPAR ")"
END 0
%left "+" "-"
%left "*" "/"
%%
input
: exp { printf ("%d\n", $1); }
;
exp
: exp "+" exp { $$ = $1 + $3; }
| exp "-" exp { $$ = $1 - $3; }
| exp "*" exp { $$ = $1 * $3; }
| exp "/" exp { $$ = $1 / $3; }
| "(" exp ")" { $$ = $2; }
| "number" { $$ = $1; }
;
%%
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <stdlib.h> /* abort */
yy::parser::symbol_type yylex ()
{
static const char* input = "0-(1+2)*3/9";
int c = *input++;
switch (c)
{
case '0':
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
case '9':
return yy::parser::make_NUM (c - '0');
case '+': return yy::parser::make_PLUS ();
case '-': return yy::parser::make_MINUS ();
case '*': return yy::parser::make_STAR ();
case '/': return yy::parser::make_SLASH ();
case '(': return yy::parser::make_LPAR ();
case ')': return yy::parser::make_RPAR ();
case 0: return yy::parser::make_END ();
}
abort ();
}
#include <cstdlib> // getenv.
#include <cstring> // strcmp.
int
main (int argc, char const* argv[])
{
yy::parser p;
int debug = !!getenv ("YYDEBUG");
for (int i = 1; i < argc; ++i)
if (!strcmp (argv[i], "-p")
|| !strcmp (argv[i], "-d") || !strcmp (argv[i], "--debug"))
debug |= 1;
else if (!strcmp (argv[i], "-s") || !strcmp (argv[i], "--stat"))
debug |= 2;
p.set_debug_level (debug);
return p.parse ();
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -o input.cc input.y"
at_fn_check_prepare_notrace 'an embedded newline' "scanner.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y" "scanner.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:330"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "scanner.at:330"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "scanner.at:330"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y"
at_fn_check_prepare_trace "scanner.at:330"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -o input.cc input.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "scanner.at:330" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/scanner.at:330"
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o input input.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS" "scanner.at:330"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o input input.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
# When api.token.raw, the yytranslate table should not be included.
#
# yacc.c, glr.c and glr.cc use 'yytranslate' (and YYTRANSLATE).
# lalr1.cc uses 'translate_table' (and yytranslate_).
# lalr1.d uses 'byte[] translate_table =' (and yytranslate_).
# lalr1.java uses 'byte[] translate_table_ =' (and yytranslate_).
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: \$EGREP -c 'yytranslate\\[\\]|translate_table\\[\\]|translate_table =|translate_table_ =' input.cc"
at_fn_check_prepare_notrace 'a shell pipeline' "scanner.at:330"
( $at_check_trace; $EGREP -c 'yytranslate\[\]|translate_table\[\]|translate_table =|translate_table_ =' input.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: \$PREPARSER ./input"
at_fn_check_prepare_dynamic " $PREPARSER ./input" "scanner.at:330"
( $at_check_trace; $PREPARSER ./input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "-1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/scanner.at:330: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "scanner.at:330"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/scanner.at:330"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_469
#AT_START_470
at_fn_group_banner 470 'calc.at:1334' \
"Calculator parse.trace " " " 17
at_xfail=no
(
printf "%s\n" "470. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.trace
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
yydebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1334"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1334"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1334"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1334" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1334"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1334"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1334"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1334"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1334"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1334"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1334"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1334: cat stderr"
at_fn_check_prepare_trace "calc.at:1334"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1334"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_470
#AT_START_471
at_fn_group_banner 471 'calc.at:1336' \
"Calculator %header " " " 17
at_xfail=no
(
printf "%s\n" "471. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%header
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1336"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1336" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1336"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1336"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1336"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1336"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1336"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1336"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1336"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1336: cat stderr"
at_fn_check_prepare_trace "calc.at:1336"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1336"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_471
#AT_START_472
at_fn_group_banner 472 'calc.at:1337' \
"Calculator %debug %locations " " " 17
at_xfail=no
(
printf "%s\n" "472. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%debug %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last_line++;
(yylloc).last_column = 1;
}
else
(yylloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first_column = (yylloc).last_column;
(yylloc).first_line = (yylloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first_line, (yylloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
yydebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1337"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1337" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1337"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1337"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1337"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1337"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1337"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1337"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1337"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1337: cat stderr"
at_fn_check_prepare_trace "calc.at:1337"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1337"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_472
#AT_START_473
at_fn_group_banner 473 'calc.at:1338' \
"Calculator %locations api.location.type={Span} " "" 17
at_xfail=no
(
printf "%s\n" "473. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%locations %define api.location.type {Span}
%code requires
{
typedef struct
{
int l;
int c;
} Point;
typedef struct
{
Point first;
Point last;
} Span;
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).first = YYRHSLOC (Rhs, 1).first; \
(Current).last = YYRHSLOC (Rhs, N).last; \
} \
else \
{ \
(Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \
} \
while (0)
#include <stdio.h>
void location_print (FILE *o, Span s);
#define LOCATION_PRINT location_print
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
%initial-action
{
@$.first.l = @$.first.c = 1;
@$.last = @$.first;
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
void
location_print (FILE *o, Span s)
{
fprintf (o, "%d.%d", s.first.l, s.first.c);
if (s.first.l != s.last.l)
fprintf (o, "-%d.%d", s.last.l, s.last.c - 1);
else if (s.first.c != s.last.c - 1)
fprintf (o, "-%d", s.last.c - 1);
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last.l++;
(yylloc).last.c = 1;
}
else
(yylloc).last.c++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first.c = (yylloc).last.c;
(yylloc).first.l = (yylloc).last.l;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first.l, (yylloc).first.c);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1338"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1338" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1338"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1338"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1338"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1338"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1338"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1338"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1338"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1338: cat stderr"
at_fn_check_prepare_trace "calc.at:1338"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1338"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_473
#AT_START_474
at_fn_group_banner 474 'calc.at:1340' \
"Calculator %name-prefix \"calc\" " " " 17
at_xfail=no
(
printf "%s\n" "474. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%name-prefix "calc"
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int calclex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1340"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1340" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1340"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1340"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1340"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1340"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1340"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1340"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1340"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1340: cat stderr"
at_fn_check_prepare_trace "calc.at:1340"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1340"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_474
#AT_START_475
at_fn_group_banner 475 'calc.at:1341' \
"Calculator %verbose " " " 17
at_xfail=no
(
printf "%s\n" "475. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1341"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1341" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1341"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1341"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1341"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1341"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1341"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1341"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1341"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1341: cat stderr"
at_fn_check_prepare_trace "calc.at:1341"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1341"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_475
#AT_START_476
at_fn_group_banner 476 'calc.at:1342' \
"Calculator %yacc " " " 17
at_xfail=no
(
printf "%s\n" "476. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1342"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1342" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1342"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1342"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1342"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1342"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1342"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1342"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1342"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1342: cat stderr"
at_fn_check_prepare_trace "calc.at:1342"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1342"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_476
#AT_START_477
at_fn_group_banner 477 'calc.at:1343' \
"Calculator parse.error=detailed " " " 17
at_xfail=no
(
printf "%s\n" "477. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1343"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1343"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1343"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1343" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1343"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1343"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1343"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1343"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1343"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1343"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1343"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1343: cat stderr"
at_fn_check_prepare_trace "calc.at:1343"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1343"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_477
#AT_START_478
at_fn_group_banner 478 'calc.at:1344' \
"Calculator parse.error=verbose " " " 17
at_xfail=no
(
printf "%s\n" "478. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1344"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1344"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1344"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1344" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1344"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1344"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1344"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1344"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1344"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1344"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1344"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1344: cat stderr"
at_fn_check_prepare_trace "calc.at:1344"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1344"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_478
#AT_START_479
at_fn_group_banner 479 'calc.at:1346' \
"Calculator api.pure=full %locations " " " 17
at_xfail=no
(
printf "%s\n" "479. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define api.pure full %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1346"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1346"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1346" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1346"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1346"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1346"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1346"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1346"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1346"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1346"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1346: cat stderr"
at_fn_check_prepare_trace "calc.at:1346"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1346"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_479
#AT_START_480
at_fn_group_banner 480 'calc.at:1347' \
"Calculator api.push-pull=both api.pure=full %locations " "" 17
at_xfail=no
(
printf "%s\n" "480. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define api.push-pull both %define api.pure full %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1347"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1347"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1347"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1347" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1347"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1347"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1347"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1347"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1347"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1347"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1347"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1347: cat stderr"
at_fn_check_prepare_trace "calc.at:1347"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1347"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_480
#AT_START_481
at_fn_group_banner 481 'calc.at:1348' \
"Calculator parse.error=detailed %locations " " " 17
at_xfail=no
(
printf "%s\n" "481. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last_line++;
(yylloc).last_column = 1;
}
else
(yylloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first_column = (yylloc).last_column;
(yylloc).first_line = (yylloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first_line, (yylloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1348"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1348"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1348"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1348" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1348"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1348"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1348"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1348"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1348"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1348"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1348"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1348: cat stderr"
at_fn_check_prepare_trace "calc.at:1348"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1348"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_481
#AT_START_482
at_fn_group_banner 482 'calc.at:1350' \
"Calculator parse.error=detailed %locations %header api.prefix={calc} %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "482. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed %locations %header %define api.prefix {calc} %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static CALCLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1350"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1350"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1350"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1350" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1350"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1350"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1350"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1350"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1350"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1350"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1350"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1350: cat stderr"
at_fn_check_prepare_trace "calc.at:1350"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1350"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_482
#AT_START_483
at_fn_group_banner 483 'calc.at:1351' \
"Calculator parse.error=detailed %locations %header %name-prefix \"calc\" api.token.prefix={TOK_} %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "483. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed %locations %header %name-prefix "calc" %define api.token.prefix {TOK_} %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return TOK_NUM;
}
/* Return end-of-file. */
if (c == EOF)
return TOK_CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return TOK_YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1351"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1351"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1351"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1351" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1351"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1351"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1351"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1351"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1351"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1351"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1351"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1351: cat stderr"
at_fn_check_prepare_trace "calc.at:1351"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1351"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_483
#AT_START_484
at_fn_group_banner 484 'calc.at:1353' \
"Calculator %debug " " " 17
at_xfail=no
(
printf "%s\n" "484. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%debug
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
yydebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1353"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1353"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1353"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1353" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1353"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1353"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1353"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1353"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1353"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1353"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1353"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1353: cat stderr"
at_fn_check_prepare_trace "calc.at:1353"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1353"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_484
#AT_START_485
at_fn_group_banner 485 'calc.at:1354' \
"Calculator parse.error=detailed %debug %locations %header %name-prefix \"calc\" %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "485. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed %debug %locations %header %name-prefix "calc" %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1354"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1354"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1354" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1354"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1354"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1354"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1354"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1354"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1354"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1354"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1354: cat stderr"
at_fn_check_prepare_trace "calc.at:1354"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1354"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_485
#AT_START_486
at_fn_group_banner 486 'calc.at:1355' \
"Calculator parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "486. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error detailed %debug %locations %header %define api.prefix {calc} %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static CALCLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1355"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1355"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1355"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1355" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1355"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1355"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1355"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1355"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1355"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1355"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1355"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1355: cat stderr"
at_fn_check_prepare_trace "calc.at:1355"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1355"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_486
#AT_START_487
at_fn_group_banner 487 'calc.at:1357' \
"Calculator api.pure=full parse.error=detailed %debug %locations %header %name-prefix \"calc\" %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "487. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define api.pure full %define parse.error detailed %debug %locations %header %name-prefix "calc" %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (YYLTYPE const * const llocp, const char *msg);
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1357"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1357"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1357"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1357" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1357"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1357"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1357"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1357"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1357"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1357"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1357"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1357: cat stderr"
at_fn_check_prepare_trace "calc.at:1357"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1357"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_487
#AT_START_488
at_fn_group_banner 488 'calc.at:1358' \
"Calculator api.push-pull=both api.pure=full parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc " "" 17
at_xfail=no
(
printf "%s\n" "488. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define api.push-pull both %define api.pure full %define parse.error detailed %debug %locations %header %define api.prefix {calc} %verbose %yacc
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1358"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1358"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1358"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1358" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1358"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1358"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1358"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1358"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1358"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1358"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1358"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1358: cat stderr"
at_fn_check_prepare_trace "calc.at:1358"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1358"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_488
#AT_START_489
at_fn_group_banner 489 'calc.at:1360' \
"Calculator api.pure parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 17
at_xfail=no
(
printf "%s\n" "489. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define api.pure %define parse.error detailed %debug %locations %header %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1360"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1360"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1360"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1360" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1360"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1360"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1360"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1360"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1360"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1360"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1360"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1360: cat stderr"
at_fn_check_prepare_trace "calc.at:1360"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1360"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_489
#AT_START_490
at_fn_group_banner 490 'calc.at:1362' \
"Calculator %no-lines api.pure parse.error=detailed %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 17
at_xfail=no
(
printf "%s\n" "490. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%no-lines %define api.pure %define parse.error detailed %debug %locations %header %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1362"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1362"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1362"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1362" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1362"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1362"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1362"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1362"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1362"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1362"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1362"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1362: cat stderr"
at_fn_check_prepare_trace "calc.at:1362"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1362"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_490
#AT_START_491
at_fn_group_banner 491 'calc.at:1363' \
"Calculator %no-lines api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 17
at_xfail=no
(
printf "%s\n" "491. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%no-lines %define api.pure %define parse.error verbose %debug %locations %header %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1363"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1363" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1363"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1363"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1363"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1363"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1363"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1363"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1363"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1363: cat stderr"
at_fn_check_prepare_trace "calc.at:1363"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1363"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_491
#AT_START_492
at_fn_group_banner 492 'calc.at:1364' \
"Calculator %no-lines api.pure parse.error=verbose %debug %locations %defines api.prefix={calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 17
at_xfail=no
(
printf "%s\n" "492. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%no-lines %define api.pure %define parse.error verbose %debug %locations %defines %define api.prefix {calc} %verbose %yacc %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364:
if \"\$POSIXLY_CORRECT_IS_EXPORTED\"; then
sed -e '/\\/\\* !POSIX \\*\\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace;
if "$POSIXLY_CORRECT_IS_EXPORTED"; then
sed -e '/\/\* !POSIX \*\//d' calc.y.tmp >calc.y
else
mv calc.y.tmp calc.y
fi
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1364"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1364"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1364"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1364" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1364"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1364"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1364"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1364"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "1017
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1364"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "80
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1364"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1364"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1364: cat stderr"
at_fn_check_prepare_trace "calc.at:1364"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1364"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_492
#AT_START_493
at_fn_group_banner 493 'calc.at:1367' \
"Calculator parse.error=custom " " " 17
at_xfail=no
(
printf "%s\n" "493. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error custom
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
int
yyreport_syntax_error (const yypcontext_t *ctx)
{
int res = 0;
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1367"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1367"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1367"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1367" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1367"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1367"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1367"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1367"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1367"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1367"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1367"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1367: cat stderr"
at_fn_check_prepare_trace "calc.at:1367"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1367"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_493
#AT_START_494
at_fn_group_banner 494 'calc.at:1368' \
"Calculator parse.error=custom %locations api.prefix={calc} " "" 17
at_xfail=no
(
printf "%s\n" "494. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error custom %locations %define api.prefix {calc}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx)
{
int res = 0;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int calclex (void);
static CALCLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1368"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1368"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1368" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1368"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1368"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1368"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1368"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1368"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1368"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1368"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1368: cat stderr"
at_fn_check_prepare_trace "calc.at:1368"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1368"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_494
#AT_START_495
at_fn_group_banner 495 'calc.at:1369' \
"Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 17
at_xfail=no
(
printf "%s\n" "495. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (result, count, nerrs, buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror (result, count, nerrs, "error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx, semantic_value *result, int *count, int *nerrs)
{
int res = 0;
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
++global_nerrs;
++*nerrs;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
#include <ctype.h>
int calclex (void);
static CALCLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1369"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1369"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1369" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1369"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1369"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1369"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1369"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1369"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1369"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1369"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1369: cat stderr"
at_fn_check_prepare_trace "calc.at:1369"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1369"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_495
#AT_START_496
at_fn_group_banner 496 'calc.at:1370' \
"Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} api.push-pull=both api.pure=full " "" 17
at_xfail=no
(
printf "%s\n" "496. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} %define api.push-pull both %define api.pure full
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx, semantic_value *result, int *count, int *nerrs)
{
int res = 0;
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
++global_nerrs;
++*nerrs;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1370"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1370"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1370" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1370"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1370"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1370"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1370"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1370"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1370"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1370"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1370: cat stderr"
at_fn_check_prepare_trace "calc.at:1370"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1370"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_496
#AT_START_497
at_fn_group_banner 497 'calc.at:1371' \
"Calculator parse.error=custom %locations api.prefix={calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} api.push-pull=both api.pure=full parse.lac=full " "" 17
at_xfail=no
(
printf "%s\n" "497. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%define parse.error custom %locations %define api.prefix {calc} %parse-param {semantic_value *result}{int *count}{int *nerrs} %define api.push-pull both %define api.pure full %define parse.lac full
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx, semantic_value *result, int *count, int *nerrs)
{
int res = 0;
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
++global_nerrs;
++*nerrs;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1371"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1371"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1371"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1371" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1371"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1371"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1371"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1371"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1371"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1371"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1371"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1371: cat stderr"
at_fn_check_prepare_trace "calc.at:1371"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1371"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_497
#AT_START_498
at_fn_group_banner 498 'calc.at:1374' \
"Calculator %start input exp NUM api.value.type=union " "" 17
at_xfail=no
(
printf "%s\n" "498. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%start input exp NUM %define api.value.type union
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
%printer { fprintf (yyo, "%d", $$); } <int>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <int> NUM "number"
%type <int> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).NUM = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
if (!strcmp (argv[i], "--exp") && i+1 < argc)
{
input = open_file (argv[i+1]);
ignore_eol = 1;
yyparse_exp_t res = yyparse_exp ();
printf ("exp => %d (status: %d, errors: %d)\n",
res.yystatus == 0 ? res.yyvalue : 0, res.yystatus, res.yynerrs);
status = res.yystatus;
++i;
}
else if (!strcmp (argv[i], "--num") && i+1 < argc)
{
input = open_file (argv[i+1]);
ignore_eol = 1;
yyparse_NUM_t res = yyparse_NUM ();
printf ("NUM => %d (status: %d, errors: %d)\n",
res.yystatus == 0 ? res.yyvalue : 0, res.yystatus, res.yynerrs);
status = res.yystatus;
++i;
}
else
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1374"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1374"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1374" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1374"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1374"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1374"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1374"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1374"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
cat >input <<'_ATEOF'
123
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc --num input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --num input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc --num input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "NUM => 123 (status: 0, errors: 0)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1374"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 + 2 * 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc --num input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --num input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc --num input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "NUM => 0 (status: 1, errors: 1)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '+', expecting end of file
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1374"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: cat stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 + 2 * 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$PREPARSER ./calc --exp input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --exp input" "calc.at:1374"
( $at_check_trace; $PREPARSER ./calc --exp input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "exp => 7 (status: 0, errors: 0)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1374"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1374: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1374"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1374"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_498
#AT_START_499
at_fn_group_banner 499 'calc.at:1375' \
"Calculator %start input exp NUM api.value.type=union %locations parse.error=detailed " "" 17
at_xfail=no
(
printf "%s\n" "499. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%start input exp NUM %define api.value.type union %locations %define parse.error detailed
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
%printer { fprintf (yyo, "%d", $$); } <int>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <int> NUM "number"
%type <int> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last_line++;
(yylloc).last_column = 1;
}
else
(yylloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first_column = (yylloc).last_column;
(yylloc).first_line = (yylloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).NUM = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first_line, (yylloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
if (!strcmp (argv[i], "--exp") && i+1 < argc)
{
input = open_file (argv[i+1]);
ignore_eol = 1;
yyparse_exp_t res = yyparse_exp ();
printf ("exp => %d (status: %d, errors: %d)\n",
res.yystatus == 0 ? res.yyvalue : 0, res.yystatus, res.yynerrs);
status = res.yystatus;
++i;
}
else if (!strcmp (argv[i], "--num") && i+1 < argc)
{
input = open_file (argv[i+1]);
ignore_eol = 1;
yyparse_NUM_t res = yyparse_NUM ();
printf ("NUM => %d (status: %d, errors: %d)\n",
res.yystatus == 0 ? res.yyvalue : 0, res.yystatus, res.yynerrs);
status = res.yystatus;
++i;
}
else
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1375"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1375"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1375"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1375" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1375"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1375"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# No direct calls to malloc/free.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$EGREP '(malloc|free) *\\(' calc.[ch] | \$EGREP -v 'INFRINGES ON USER NAME SPACE'"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1375"
( $at_check_trace; $EGREP '(malloc|free) *\(' calc.[ch] | $EGREP -v 'INFRINGES ON USER NAME SPACE'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1375"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1375"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
cat >input <<'_ATEOF'
123
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc --num input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --num input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc --num input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "NUM => 123 (status: 0, errors: 0)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1375"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 + 2 * 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc --num input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --num input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc --num input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "NUM => 0 (status: 1, errors: 1)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error, unexpected '+', expecting end of file
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1375"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: cat stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 + 2 * 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$PREPARSER ./calc --exp input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc --exp input" "calc.at:1375"
( $at_check_trace; $PREPARSER ./calc --exp input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "exp => 7 (status: 0, errors: 0)
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1375"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1375: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1375"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1375"
$at_failed && at_fn_log_failure
$at_traceon; }
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_499
#AT_START_500
at_fn_group_banner 500 'calc.at:1387' \
"Calculator %glr-parser " " " 18
at_xfail=no
(
printf "%s\n" "500. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1387"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1387"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1387"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1387" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1387"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1387"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1387"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1387"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1387: cat stderr"
at_fn_check_prepare_trace "calc.at:1387"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1387"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_500
#AT_START_501
at_fn_group_banner 501 'calc.at:1389' \
"Calculator %glr-parser %header " " " 18
at_xfail=no
(
printf "%s\n" "501. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %header
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1389"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1389"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1389"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1389" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1389"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1389"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1389"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1389"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1389: cat stderr"
at_fn_check_prepare_trace "calc.at:1389"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1389"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_501
#AT_START_502
at_fn_group_banner 502 'calc.at:1390' \
"Calculator %glr-parser %locations " " " 18
at_xfail=no
(
printf "%s\n" "502. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last_line++;
(yylloc).last_column = 1;
}
else
(yylloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first_column = (yylloc).last_column;
(yylloc).first_line = (yylloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first_line, (yylloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1390"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1390"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1390" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1390"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1390"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1390"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1390"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1390: cat stderr"
at_fn_check_prepare_trace "calc.at:1390"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1390"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_502
#AT_START_503
at_fn_group_banner 503 'calc.at:1391' \
"Calculator %glr-parser %locations api.location.type={Span} " "" 18
at_xfail=no
(
printf "%s\n" "503. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %locations %define api.location.type {Span}
%code requires
{
typedef struct
{
int l;
int c;
} Point;
typedef struct
{
Point first;
Point last;
} Span;
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).first = YYRHSLOC (Rhs, 1).first; \
(Current).last = YYRHSLOC (Rhs, N).last; \
} \
else \
{ \
(Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \
} \
while (0)
#include <stdio.h>
void location_print (FILE *o, Span s);
#define LOCATION_PRINT location_print
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
%initial-action
{
@$.first.l = @$.first.c = 1;
@$.last = @$.first;
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
void
location_print (FILE *o, Span s)
{
fprintf (o, "%d.%d", s.first.l, s.first.c);
if (s.first.l != s.last.l)
fprintf (o, "-%d.%d", s.last.l, s.last.c - 1);
else if (s.first.c != s.last.c - 1)
fprintf (o, "-%d", s.last.c - 1);
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last.l++;
(yylloc).last.c = 1;
}
else
(yylloc).last.c++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first.c = (yylloc).last.c;
(yylloc).first.l = (yylloc).last.l;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first.l, (yylloc).first.c);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1391"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1391"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1391"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1391" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1391"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1391"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1391"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1391"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1391: cat stderr"
at_fn_check_prepare_trace "calc.at:1391"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1391"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_503
#AT_START_504
at_fn_group_banner 504 'calc.at:1392' \
"Calculator %glr-parser %name-prefix \"calc\" " " " 18
at_xfail=no
(
printf "%s\n" "504. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %name-prefix "calc"
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int calclex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1392"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1392"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1392" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1392"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1392"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1392"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1392"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1392: cat stderr"
at_fn_check_prepare_trace "calc.at:1392"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1392"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_504
#AT_START_505
at_fn_group_banner 505 'calc.at:1393' \
"Calculator %glr-parser api.prefix={calc} " " " 18
at_xfail=no
(
printf "%s\n" "505. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define api.prefix {calc}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int calclex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1393"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1393"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1393"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1393" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1393"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1393"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1393"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1393"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1393: cat stderr"
at_fn_check_prepare_trace "calc.at:1393"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1393"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_505
#AT_START_506
at_fn_group_banner 506 'calc.at:1394' \
"Calculator %glr-parser %verbose " " " 18
at_xfail=no
(
printf "%s\n" "506. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1394"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1394"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1394" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1394"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1394"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1394"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1394"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1394: cat stderr"
at_fn_check_prepare_trace "calc.at:1394"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1394"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_506
#AT_START_507
at_fn_group_banner 507 'calc.at:1395' \
"Calculator %glr-parser parse.error=verbose " " " 18
at_xfail=no
(
printf "%s\n" "507. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1395"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1395"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1395"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1395" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1395"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1395"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1395"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1395"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1395: cat stderr"
at_fn_check_prepare_trace "calc.at:1395"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1395"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_507
#AT_START_508
at_fn_group_banner 508 'calc.at:1397' \
"Calculator %glr-parser api.pure %locations " " " 18
at_xfail=no
(
printf "%s\n" "508. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define api.pure %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (YYLTYPE const * const llocp, const char *msg);
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1397"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1397"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1397"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1397" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1397"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1397"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1397"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1397"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1397: cat stderr"
at_fn_check_prepare_trace "calc.at:1397"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1397"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_508
#AT_START_509
at_fn_group_banner 509 'calc.at:1398' \
"Calculator %glr-parser parse.error=verbose %locations " "" 18
at_xfail=no
(
printf "%s\n" "509. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
LOCATION_PRINT (stderr, (yylloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (yylloc);
if (res == '\n')
{
(yylloc).last_line++;
(yylloc).last_column = 1;
}
else
(yylloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(yylloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
(yylloc).first_column = (yylloc).last_column;
(yylloc).first_line = (yylloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(yylloc).first_line, (yylloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1398"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1398"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1398"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1398" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1398"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1398"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1398"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1398"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1398: cat stderr"
at_fn_check_prepare_trace "calc.at:1398"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1398"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_509
#AT_START_510
at_fn_group_banner 510 'calc.at:1400' \
"Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "510. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error custom %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx)
{
int res = 0;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1400"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1400"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1400"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1400"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1400"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1400" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1400"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1400"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1400"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1400"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1400: cat stderr"
at_fn_check_prepare_trace "calc.at:1400"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1400"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_510
#AT_START_511
at_fn_group_banner 511 'calc.at:1401' \
"Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose api.pure " "" 18
at_xfail=no
(
printf "%s\n" "511. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error custom %locations %header %name-prefix "calc" %verbose %define api.pure
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (YYLTYPE const * const llocp, const char *msg);
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx)
{
int res = 0;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1401"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1401"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1401"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1401"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1401"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1401" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1401"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1401"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1401"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1401"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1401: cat stderr"
at_fn_check_prepare_trace "calc.at:1401"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1401"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_511
#AT_START_512
at_fn_group_banner 512 'calc.at:1402' \
"Calculator %glr-parser parse.error=detailed %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "512. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error detailed %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1402"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1402"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1402"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1402" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1402"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1402"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1402"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1402"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1402: cat stderr"
at_fn_check_prepare_trace "calc.at:1402"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1402"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_512
#AT_START_513
at_fn_group_banner 513 'calc.at:1403' \
"Calculator %glr-parser parse.error=verbose %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "513. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1403"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1403"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1403" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1403"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1403"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1403"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1403"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1403: cat stderr"
at_fn_check_prepare_trace "calc.at:1403"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1403"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_513
#AT_START_514
at_fn_group_banner 514 'calc.at:1405' \
"Calculator %glr-parser parse.error=custom %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "514. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error custom %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
#define N_
static
const char *
_ (const char *cp)
{
if (strcmp (cp, "end of input") == 0)
return "end of file";
else if (strcmp (cp, "number") == 0)
return "nombre";
else
return cp;
}
}
/* Bison Declarations */
%token CALC_EOF 0 _("end of file")
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
int
yyreport_syntax_error (const yypcontext_t *ctx)
{
int res = 0;
LOCATION_PRINT (stderr, *yypcontext_location (ctx));
fprintf (stderr, ": ");
fprintf (stderr, "syntax error");
{
yysymbol_kind_t la = yypcontext_token (ctx);
if (la != YYSYMBOL_YYEMPTY)
fprintf (stderr, " on token [%s]", yysymbol_name (la));
}
{
enum { TOKENMAX = 10 };
yysymbol_kind_t expected[TOKENMAX];
int n = yypcontext_expected_tokens (ctx, expected, TOKENMAX);
/* Forward errors to yyparse. */
if (n <= 0)
res = n;
else
{
fprintf (stderr, " (expected:");
for (int i = 0; i < n; ++i)
fprintf (stderr, " [%s]", yysymbol_name (expected[i]));
fprintf (stderr, ")");
}
}
fprintf (stderr, "\n");
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1405"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1405"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1405"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1405"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1405"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1405" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1405"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1405"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1405"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of file] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of file] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1405"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1405: cat stderr"
at_fn_check_prepare_trace "calc.at:1405"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1405"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_514
#AT_START_515
at_fn_group_banner 515 'calc.at:1407' \
"Calculator %glr-parser %debug " " " 18
at_xfail=no
(
printf "%s\n" "515. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %debug
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
/* !POSIX */ static void yyerror (const char *msg);
int yylex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C error reporting function. */
/* !POSIX */ static
void yyerror (const char *msg)
{
fprintf (stderr, "%s\n", msg);
}
#include <ctype.h>
int yylex (void);
static int
get_char (void)
{
int res = getc (input);
;
return res;
}
static void
unget_char ( int c)
{
;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (void)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(yylval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
yydebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1407"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1407"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1407"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1407" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1407"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS" "calc.at:1407"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1407"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1407"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1407: cat stderr"
at_fn_check_prepare_trace "calc.at:1407"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1407"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_515
#AT_START_516
at_fn_group_banner 516 'calc.at:1408' \
"Calculator %glr-parser parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "516. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %debug %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static YYLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1408"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1408"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1408"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1408" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1408"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1408"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1408"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1408"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1408: cat stderr"
at_fn_check_prepare_trace "calc.at:1408"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1408"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_516
#AT_START_517
at_fn_group_banner 517 'calc.at:1409' \
"Calculator %glr-parser parse.error=verbose %debug %locations %header api.prefix={calc} api.token.prefix={TOK_} %verbose " "" 18
at_xfail=no
(
printf "%s\n" "517. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define parse.error verbose %debug %locations %header %define api.prefix {calc} %define api.token.prefix {TOK_} %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (const char *msg);
int calclex (void);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
{
YYLTYPE old_yylloc = yylloc;
yylloc = @$;
yyerror (buf);
yylloc = old_yylloc;
}
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
{
YYLTYPE old_yylloc = yylloc;
yylloc = @3;
yyerror ("error: null divisor");
yylloc = old_yylloc;
}
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (const char *msg)
{
LOCATION_PRINT (stderr, (calclloc));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (void);
static CALCLTYPE last_yylloc;
static int
get_char (void)
{
int res = getc (input);
;
last_yylloc = (calclloc);
if (res == '\n')
{
(calclloc).last_line++;
(calclloc).last_column = 1;
}
else
(calclloc).last_column++;
return res;
}
static void
unget_char ( int c)
{
;
/* Wrong when C == '\n'. */
(calclloc) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (void)
{
int c = get_char ();
int res = 0;
;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char ();
}
unget_char ( c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (void)
{
int c;
/* Skip white spaces. */
do
{
(calclloc).first_column = (calclloc).last_column;
(calclloc).first_line = (calclloc).last_line;
}
while ((c = get_char ()) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char ( c);
(calclval).ival = read_integer ();
return TOK_NUM;
}
/* Return end-of-file. */
if (c == EOF)
return TOK_CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(calclloc).first_line, (calclloc).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return TOK_CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1409"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1409"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1409" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1409"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1409"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1409"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1409"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1409: cat stderr"
at_fn_check_prepare_trace "calc.at:1409"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1409"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_517
#AT_START_518
at_fn_group_banner 518 'calc.at:1411' \
"Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose " "" 18
at_xfail=no
(
printf "%s\n" "518. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %header %name-prefix "calc" %verbose
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (YYLTYPE const * const llocp, const char *msg);
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (YYLTYPE const * const llocp, const char *msg)
{
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1411"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1411"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1411"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1411" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1411"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1411"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1411"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1411"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1411: cat stderr"
at_fn_check_prepare_trace "calc.at:1411"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1411"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_518
#AT_START_519
at_fn_group_banner 519 'calc.at:1413' \
"Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header %name-prefix \"calc\" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 18
at_xfail=no
(
printf "%s\n" "519. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %header %name-prefix "calc" %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, YYLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, YYLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (YYLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp);
static YYLTYPE last_yylloc;
static int
get_char (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (YYSTYPE *lvalp, YYLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (YYSTYPE *lvalp, YYLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1413"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1413"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1413"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1413" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1413"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1413"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1413"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1413"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1413: cat stderr"
at_fn_check_prepare_trace "calc.at:1413"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1413"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_519
#AT_START_520
at_fn_group_banner 520 'calc.at:1414' \
"Calculator %glr-parser api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 18
at_xfail=no
(
printf "%s\n" "520. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %define api.pure %define parse.error verbose %debug %locations %header %define api.prefix {calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1414"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1414"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1414"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1414" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1414"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1414"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1414"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1414"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1414: cat stderr"
at_fn_check_prepare_trace "calc.at:1414"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1414"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_520
#AT_START_521
at_fn_group_banner 521 'calc.at:1416' \
"Calculator %glr-parser %no-lines api.pure parse.error=verbose %debug %locations %header api.prefix={calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs} " "" 18
at_xfail=no
(
printf "%s\n" "521. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%glr-parser %no-lines %define api.pure %define parse.error verbose %debug %locations %header %define api.prefix {calc} %verbose %parse-param {semantic_value *result}{int *count}{int *nerrs}
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { fprintf (yyo, "%d", $$); } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
#include <stdio.h>
#if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
static int location_print (FILE *yyo, CALCLTYPE const * const yylocp);
# ifndef LOCATION_PRINT
# define LOCATION_PRINT(File, Loc) location_print (File, &(Loc))
# endif
#endif
/* !POSIX */ static void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg);
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { ++*count; ++global_count; }
;
line:
'\n'
| exp '\n' { *result = global_result = $1; }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
yyerror (&@$, result, count, nerrs, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
yyerror (&@3, result, count, nerrs, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
| '!' '*' { $$ = 0; YYNOMEM; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
# if defined CALCLTYPE_IS_TRIVIAL && CALCLTYPE_IS_TRIVIAL
/* Print *YYLOCP on YYO. */
__attribute__((__unused__))
static int
location_print (FILE *yyo, CALCLTYPE const * const yylocp)
{
int res = 0;
int end_col = 0 != yylocp->last_column ? yylocp->last_column - 1 : 0;
if (0 <= yylocp->first_line)
{
res += fprintf (yyo, "%d", yylocp->first_line);
if (0 <= yylocp->first_column)
res += fprintf (yyo, ".%d", yylocp->first_column);
}
if (0 <= yylocp->last_line)
{
if (yylocp->first_line < yylocp->last_line)
{
res += fprintf (yyo, "-%d", yylocp->last_line);
if (0 <= end_col)
res += fprintf (yyo, ".%d", end_col);
}
else if (0 <= end_col && yylocp->first_column < end_col)
res += fprintf (yyo, "-%d", end_col);
}
return res;
}
#endif
/* A C error reporting function. */
/* !POSIX */ static
void calcerror (CALCLTYPE const * const llocp, semantic_value *result, int *count, int *nerrs, const char *msg)
{
YY_USE (result);
YY_USE (count);
YY_USE (nerrs);
LOCATION_PRINT (stderr, (*llocp));
fprintf (stderr, ": ");
fprintf (stderr, "%s\n", msg);
++global_nerrs;
++*nerrs;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <ctype.h>
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp);
static CALCLTYPE last_yylloc;
static int
get_char (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last_line++;
(*llocp).last_column = 1;
}
else
(*llocp).last_column++;
return res;
}
static void
unget_char (CALCSTYPE *lvalp, CALCLTYPE *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int calclex (CALCSTYPE *lvalp, CALCLTYPE *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first_column = (*llocp).last_column;
(*llocp).first_line = (*llocp).last_line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return NUM;
}
/* Return end-of-file. */
if (c == EOF)
return CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first_line, (*llocp).first_column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return CALCerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.c <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.h"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
semantic_value result = 0;
int count = 0;
int nerrs = 0;
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
calcdebug = 1;
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = calcparse (&result, &count, &nerrs);
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
assert (global_result == result); (void) result;
assert (global_count == count); (void) count;
assert (global_nerrs == nerrs); (void) nerrs;
printf ("final: %d %d %d\n", global_result, global_count, global_nerrs);
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y" "calc.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1416"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1416"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.c calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1416" >"$at_check_line_file"
(! $BISON_C_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1416"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$CC \$CFLAGS \$CPPFLAGS \$LDFLAGS -o calc calc.c calc-lex.c calc-main.c \$LIBS"
at_fn_check_prepare_dynamic "$CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS" "calc.at:1416"
( $at_check_trace; $CC $CFLAGS $CPPFLAGS $LDFLAGS -o calc calc.c calc-lex.c calc-main.c $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.c calc.h
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.c calc.h
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 64 12 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 4444 0 5
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 2
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 3333 0 3
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYNOMEM.
cat >input <<'_ATEOF'
1 + 2 * 3 + !* ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 0 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 2 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.14: memory exhausted
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2222 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 1111 0 0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1416"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
echo >>"$at_stdout"; printf "%s\n" "final: 2 0 1
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1416"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1416: cat stderr"
at_fn_check_prepare_trace "calc.at:1416"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1416"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_521
#AT_START_522
at_fn_group_banner 522 'calc.at:1426' \
"Calculator lalr1.cc %header " " " 19
at_xfail=no
(
printf "%s\n" "522. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%skeleton "lalr1.cc" %header
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { yyo << $$; } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
int yylex (yy::parser::value_type *lvalp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
error (buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
error ("error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >calc-lex.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.hh"
#include <ctype.h>
int yylex (yy::parser::value_type *lvalp);
static int
get_char (yy::parser::value_type *lvalp)
{
int res = getc (input);
(void) lvalp;;
return res;
}
static void
unget_char (yy::parser::value_type *lvalp, int c)
{
(void) lvalp;;
ungetc (c, input);
}
static int
read_integer (yy::parser::value_type *lvalp)
{
int c = get_char (lvalp);
int res = 0;
(void) lvalp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp);
}
unget_char (lvalp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (yy::parser::value_type *lvalp)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char (lvalp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, c);
(*lvalp).ival = read_integer (lvalp);
return yy::parser::token::NUM;
}
/* Return end-of-file. */
if (c == EOF)
return yy::parser::token::CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return yy::parser::token::YYerror;
}
/* Return single chars. */
return c;
}
_ATEOF
cat >calc-main.cc <<'_ATEOF'
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
#include "calc.hh"
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
namespace
{
/* A C++ yyparse that simulates the C signature. */
int
yyparse ()
{
yy::parser parser;
#if YYDEBUG
parser.set_debug_level (1);
#endif
return parser.parse ();
}
}
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:1426"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1426"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1426"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1426" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1426"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS" "calc.at:1426"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc calc-lex.cc calc-main.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.cc calc.hh
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.cc calc.hh
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1426"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1426"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1426"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1426"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1426: cat stderr"
at_fn_check_prepare_trace "calc.at:1426"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1426"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_522
#AT_START_523
at_fn_group_banner 523 'calc.at:1431' \
"Calculator C++ " " " 19
at_xfail=no
(
printf "%s\n" "523. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%language "C++"
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { yyo << $$; } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
int yylex (yy::parser::value_type *lvalp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
error (buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
error ("error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const std::string& m)
{
std::cerr << m << '\n';
}
#include <ctype.h>
int yylex (yy::parser::value_type *lvalp);
static int
get_char (yy::parser::value_type *lvalp)
{
int res = getc (input);
(void) lvalp;;
return res;
}
static void
unget_char (yy::parser::value_type *lvalp, int c)
{
(void) lvalp;;
ungetc (c, input);
}
static int
read_integer (yy::parser::value_type *lvalp)
{
int c = get_char (lvalp);
int res = 0;
(void) lvalp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp);
}
unget_char (lvalp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (yy::parser::value_type *lvalp)
{
int c;
/* Skip white spaces. */
do
{
}
while ((c = get_char (lvalp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, c);
(*lvalp).ival = read_integer (lvalp);
return yy::parser::token::NUM;
}
/* Return end-of-file. */
if (c == EOF)
return yy::parser::token::CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fputs ("syntax error: invalid character: '#'\n", stderr);
return yy::parser::token::YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
namespace
{
/* A C++ yyparse that simulates the C signature. */
int
yyparse ()
{
yy::parser parser;
#if YYDEBUG
parser.set_debug_level (1);
#endif
return parser.parse ();
}
}
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:1431"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1431"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1431"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1431" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1431"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:1431"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.cc
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1431"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1431"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1431"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
sed 's/^[-0-9.]*: //' expout >at-expout
mv at-expout expout
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1431"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1431: cat stderr"
at_fn_check_prepare_trace "calc.at:1431"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1431"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_523
#AT_START_524
at_fn_group_banner 524 'calc.at:1432' \
"Calculator C++ %locations " " " 19
at_xfail=no
(
printf "%s\n" "524. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%language "C++" %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { yyo << $$; } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
error (@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
error (@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <ctype.h>
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
static yy::parser::location_type last_yylloc;
static int
get_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).end.line++;
(*llocp).end.column = 1;
}
else
(*llocp).end.column++;
return res;
}
static void
unget_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).begin.column = (*llocp).end.column;
(*llocp).begin.line = (*llocp).end.line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return yy::parser::token::NUM;
}
/* Return end-of-file. */
if (c == EOF)
return yy::parser::token::CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).begin.line, (*llocp).begin.column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return yy::parser::token::YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
namespace
{
/* A C++ yyparse that simulates the C signature. */
int
yyparse ()
{
yy::parser parser;
#if YYDEBUG
parser.set_debug_level (1);
#endif
return parser.parse ();
}
}
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1432"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1432"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1432" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1432"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:1432"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.cc
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1432"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1432"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1432"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1432"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1432: cat stderr"
at_fn_check_prepare_trace "calc.at:1432"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1432"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_524
#AT_START_525
at_fn_group_banner 525 'calc.at:1433' \
"Calculator C++ %locations \$NO_EXCEPTIONS_CXXFLAGS" "" 19
at_xfail=no
(
printf "%s\n" "525. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%language "C++" %locations
%code requires
{
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { yyo << $$; } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
error (@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
error (@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <ctype.h>
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
static yy::parser::location_type last_yylloc;
static int
get_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).end.line++;
(*llocp).end.column = 1;
}
else
(*llocp).end.column++;
return res;
}
static void
unget_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).begin.column = (*llocp).end.column;
(*llocp).begin.line = (*llocp).end.line;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return yy::parser::token::NUM;
}
/* Return end-of-file. */
if (c == EOF)
return yy::parser::token::CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).begin.line, (*llocp).begin.column);
fputs ("syntax error: invalid character: '#'\n", stderr);
return yy::parser::token::YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
namespace
{
/* A C++ yyparse that simulates the C signature. */
int
yyparse ()
{
yy::parser parser;
#if YYDEBUG
parser.set_debug_level (1);
#endif
return parser.parse ();
}
}
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:1433"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1433"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1433"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1433" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1433"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$CXX \$CPPFLAGS \$CXXFLAGS \$NO_EXCEPTIONS_CXXFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $NO_EXCEPTIONS_CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:1433"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $NO_EXCEPTIONS_CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.cc
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1433"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1433"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1433"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1433"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1433: cat stderr"
at_fn_check_prepare_trace "calc.at:1433"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1433"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_525
#AT_START_526
at_fn_group_banner 526 'calc.at:1434' \
"Calculator C++ %locations api.location.type={Span} " "" 19
at_xfail=no
(
printf "%s\n" "526. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'
%code top { /* -*- c++ -*- */
/* Adjust to the compiler.
We used to do it here, but each time we add a new line,
we have to adjust all the line numbers in error messages.
It's simpler to use a constant include to a varying file. */
#include <testsuite.h>
}
/* Infix notation calculator--calc */
%language "C++" %locations %define api.location.type {Span}
%code requires
{
typedef struct
{
int l;
int c;
} Point;
typedef struct
{
Point first;
Point last;
} Span;
# define YYLLOC_DEFAULT(Current, Rhs, N) \
do \
if (N) \
{ \
(Current).first = YYRHSLOC (Rhs, 1).first; \
(Current).last = YYRHSLOC (Rhs, N).last; \
} \
else \
{ \
(Current).first = (Current).last = YYRHSLOC (Rhs, 0).last; \
} \
while (0)
/* Exercise pre-prologue dependency to %union. */
typedef int semantic_value;
}
/* Exercise %union. */
%union
{
semantic_value ival;
};
%printer { yyo << $$; } <ival>;
%code provides
{
#include <stdio.h>
/* The input. */
extern FILE *input;
/* Whether \n is a blank. */
extern int ignore_eol;
extern semantic_value global_result;
extern int global_count;
extern int global_nerrs;
}
%code
{
#include <assert.h>
#include <string.h>
#define USE(Var)
FILE *input;
int ignore_eol = 0;
static int power (int base, int exponent);
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
}
%initial-action
{
@$.first.l = @$.first.c = 1;
@$.last = @$.first;
}
/* Bison Declarations */
%token CALC_EOF 0 "end of input"
%token <ival> NUM "number"
%type <ival> exp
%nonassoc '=' /* comparison */
%left '-' '+'
%left '*' '/'
%precedence NEG /* negation--unary minus */
%right '^' /* exponentiation */
/* Grammar follows */
%%
input:
line
| input line { }
;
line:
'\n'
| exp '\n' { USE ($1); }
;
exp:
NUM
| exp '=' exp
{
if ($1 != $3)
{
char buf[1024];
snprintf (buf, sizeof buf, "error: %d != %d", $1, $3);
error (@$, buf);
}
$$ = $1;
}
| exp '+' exp { $$ = $1 + $3; }
| exp '-' exp { $$ = $1 - $3; }
| exp '*' exp { $$ = $1 * $3; }
| exp '/' exp
{
if ($3 == 0)
{
error (@3, "error: null divisor");
}
else
$$ = $1 / $3;
}
| '-' exp %prec NEG { $$ = -$2; }
| exp '^' exp { $$ = power ($1, $3); }
| '(' exp ')' { $$ = $2; }
| '(' error ')' { $$ = 1111; yyerrok; }
| '-' error { $$ = 0; YYERROR; }
| '!' '!' { $$ = 0; YYERROR; }
| '!' '+' { $$ = 0; YYACCEPT; }
| '!' '-' { $$ = 0; YYABORT; }
;
%%
int
power (int base, int exponent)
{
int res = 1;
assert (0 <= exponent);
for (/* Niente */; exponent; --exponent)
res *= base;
return res;
}
#include <iostream>
namespace
{
std::ostream&
operator<< (std::ostream& o, const Span& s)
{
o << s.first.l << '.' << s.first.c;
if (s.first.l != s.last.l)
o << '-' << s.last.l << '.' << s.last.c - 1;
else if (s.first.c != s.last.c - 1)
o << '-' << s.last.c - 1;
return o;
}
}
/* A C++ error reporting function. */
void
yy::parser::error (const location_type& l, const std::string& m)
{
std::cerr << l << ": " << m << '\n';
}
#include <ctype.h>
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp);
static yy::parser::location_type last_yylloc;
static int
get_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int res = getc (input);
(void) lvalp;(void) llocp;;
last_yylloc = (*llocp);
if (res == '\n')
{
(*llocp).last.l++;
(*llocp).last.c = 1;
}
else
(*llocp).last.c++;
return res;
}
static void
unget_char (yy::parser::value_type *lvalp, yy::parser::location_type *llocp, int c)
{
(void) lvalp;(void) llocp;;
/* Wrong when C == '\n'. */
(*llocp) = last_yylloc;
ungetc (c, input);
}
static int
read_integer (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c = get_char (lvalp, llocp);
int res = 0;
(void) lvalp;(void) llocp;;
while (isdigit (c))
{
res = 10 * res + (c - '0');
c = get_char (lvalp, llocp);
}
unget_char (lvalp, llocp, c);
return res;
}
/*---------------------------------------------------------------.
| Lexical analyzer returns an integer on the stack and the token |
| NUM, or the ASCII character read if not a number. Skips all |
| blanks and tabs, returns 0 for EOF. |
`---------------------------------------------------------------*/
int yylex (yy::parser::value_type *lvalp, yy::parser::location_type *llocp)
{
int c;
/* Skip white spaces. */
do
{
(*llocp).first.c = (*llocp).last.c;
(*llocp).first.l = (*llocp).last.l;
}
while ((c = get_char (lvalp, llocp)) == ' '
|| c == '\t'
|| (ignore_eol && c == '\n'));
/* Process numbers. */
if (isdigit (c))
{
unget_char (lvalp, llocp, c);
(*lvalp).ival = read_integer (lvalp, llocp);
return yy::parser::token::NUM;
}
/* Return end-of-file. */
if (c == EOF)
return yy::parser::token::CALC_EOF;
/* An explicit error raised by the scanner. */
if (c == '#')
{
fprintf (stderr, "%d.%d: ",
(*llocp).first.l, (*llocp).first.c);
fputs ("syntax error: invalid character: '#'\n", stderr);
return yy::parser::token::YYerror;
}
/* Return single chars. */
return c;
}
#include <assert.h>
#include <stdlib.h> /* exit */
#include <string.h> /* strcmp */
#include <unistd.h>
namespace
{
/* A C++ yyparse that simulates the C signature. */
int
yyparse ()
{
yy::parser parser;
#if YYDEBUG
parser.set_debug_level (1);
#endif
return parser.parse ();
}
}
/* Value of the last computation. */
semantic_value global_result = 0;
/* Total number of computations. */
int global_count = 0;
/* Total number of errors. */
int global_nerrs = 0;
#ifndef EX_NOINPUT
# define EX_NOINPUT 66
#endif
static FILE *
open_file (const char *file)
{
FILE *res = (file && *file && strcmp (file, "-")) ? fopen (file, "r") : stdin;
if (!res)
{
perror (file);
exit (EX_NOINPUT);
}
return res;
}
/* A C main function. */
int
main (int argc, const char **argv)
{
int status = 0;
/* This used to be alarm (10), but that isn't enough time for a July
1995 vintage DEC Alphastation 200 4/100 system, according to
Nelson H. F. Beebe. 100 seconds was enough for regular users,
but the Hydra build farm, which is heavily loaded needs more. */
alarm (200);
{
int i;
for (i = 1; i < argc; ++i)
{
{
input = open_file (argv[i]);
status = yyparse ();
}
if (input != stdin && fclose (input))
perror ("fclose");
}
}
return status;
}
_ATEOF
# Remove the generated prototypes.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: mv calc.y.tmp calc.y
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; mv calc.y.tmp calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$BISON_TEST_XML" = x1 && test x"$XSLTPROC" != x""; then
at_save_special_files
mkdir xml-tests
# Don't combine these Bison invocations since we want to be sure that
# --report=all isn't required to get the full XML file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \\
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --report=all --report-file=xml-tests/test.output \
--graph=xml-tests/test.gv -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_dynamic "COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y" "calc.at:1434"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --color=no -fno-caret --xml=xml-tests/test.xml -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cp xml-tests/test.output expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2text.xsl \\
xml-tests/test.xml"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1434"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2text.xsl \
xml-tests/test.xml
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# xml2text and xml2dot always use '•', while --report uses '•' or '.'
# depending on the locale, and the test suite is run with the plain
# C locale.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed -e 's/•/./g' stdout"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed -e 's/•/./g' stdout
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
sort xml-tests/test.gv > expout
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$XSLTPROC \\
\`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS=\"\$VALGRIND_OPTS --leak-check=summary --show-reachable=no\"; export VALGRIND_OPTS; bison --print-datadir\`/xslt/xml2dot.xsl \\
xml-tests/test.xml | sort | sed -e 's/•/./g'"
at_fn_check_prepare_notrace 'a `...` command substitution' "calc.at:1434"
( $at_check_trace; $XSLTPROC \
`COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; VALGRIND_OPTS="$VALGRIND_OPTS --leak-check=summary --show-reachable=no"; export VALGRIND_OPTS; bison --print-datadir`/xslt/xml2dot.xsl \
xml-tests/test.xml | sort | sed -e 's/•/./g'
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo stdout:; tee stdout <"$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
rm -rf xml-tests expout
at_restore_special_files
fi
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; COLUMNS=1000; export COLUMNS; NO_TERM_HYPERLINKS=1; export NO_TERM_HYPERLINKS; bison --color=no -fno-caret -Wno-deprecated -o calc.cc calc.y
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
printf "%s\n" "calc.at:1434" >"$at_check_line_file"
(! $BISON_CXX_WORKS) \
&& at_fn_check_skip 77 "$at_srcdir/calc.at:1434"
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$CXX \$CPPFLAGS \$CXXFLAGS \$LDFLAGS -o calc calc.cc \$LIBS"
at_fn_check_prepare_dynamic "$CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS" "calc.at:1434"
( $at_check_trace; $CXX $CPPFLAGS $CXXFLAGS $LDFLAGS -o calc calc.cc $LIBS
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; cat "$at_stderr"
echo stdout:; cat "$at_stdout"
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
if test x"$PERL" != x; then
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -ne '
chomp;
print \"\$ARGV:\$.: {\$_}\\n\"
if (# No starting/ending empty lines.
(eof || \$. == 1) && /^\\s*\$/
# No trailing space.
|| /\\s\$/
# No tabs.
|| /\\t/
)' calc.cc
"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -ne '
chomp;
print "$ARGV:$.: {$_}\n"
if (# No starting/ending empty lines.
(eof || $. == 1) && /^\s*$/
# No trailing space.
|| /\s$/
# No tabs.
|| /\t/
)' calc.cc
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
fi
# Test the precedences.
# The Java traces do not show the clean up sequence at the end,
# since it does not support %destructor.
cat >input <<'_ATEOF'
1 + 2 * 3 = 7
1 + 2 * -3 = -5
-1^2 = -1
(-1)^2 = 1
---1 = -1
1 - 2 - 3 = -4
1 - (2 - 3) = 2
2^2^3 = 256
(2^2)^3 = 64
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1434"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Some syntax errors.
cat >input <<'_ATEOF'
1 2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] ['\n'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1//2
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.3: syntax error on token ['/'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
error
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [invalid token] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
1 = 2 = 3
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.7: syntax error on token ['='] (expected: ['-'] ['+'] ['*'] ['/'] ['^'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
+1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
2.1: syntax error on token ['+'] (expected: [end of input] [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise error messages with EOF: work on an empty file.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc /dev/null"
at_fn_check_prepare_dynamic " $PREPARSER ./calc /dev/null" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc /dev/null
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.1: syntax error on token [end of input] (expected: [number] ['-'] ['\n'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Exercise the error token: without it, we die at the first error,
# hence be sure to
#
# - have several errors which exercise different shift/discardings
# - (): nothing to pop, nothing to discard
# - (1 + 1 + 1 +): a lot to pop, nothing to discard
# - (* * *): nothing to pop, a lot to discard
# - (1 + 2 * *): some to pop and discard
#
# - test the action associated to 'error'
#
# - check the lookahead that triggers an error is not discarded
# when we enter error recovery. Below, the lookahead causing the
# first error is ")", which is needed to recover from the error and
# produce the "0" that triggers the "0 != 1" error.
#
cat >input <<'_ATEOF'
() + (1 + 1 + 1 +) + (* * *) + (1 * 2 * *) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.18: syntax error on token [')'] (expected: [number] ['-'] ['('] ['!'])
1.23: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.41: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.1-46: error: 4444 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# The same, but this time exercising explicitly triggered syntax errors.
# POSIX says the lookahead causing the error should not be discarded.
cat >input <<'_ATEOF'
(!!) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-16: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(- *) + (1 2) = 1
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.4: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.12: syntax error on token [number] (expected: ['='] ['-'] ['+'] ['*'] ['/'] ['^'] [')'])
1.1-17: error: 2222 != 1
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Check that yyerrok works properly: second error is not reported,
# third and fourth are. Parse status is successful.
cat >input <<'_ATEOF'
(* *) + (*) + (*)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.10: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
1.16: syntax error on token ['*'] (expected: [number] ['-'] ['('] ['!'])
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Special actions.
# ----------------
# !+ => YYACCEPT, !- => YYABORT, !! => YYERROR, !* => YYNOMEM.
# YYACCEPT.
# Java lacks the traces at the end for cleaning the stack
# -Stack now 0 8 20
# -Cleanup: popping token '+' (1.1: )
# -Cleanup: popping nterm exp (1.1: 7)
cat >input <<'_ATEOF'
1 + 2 * 3 + !+ ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$EGREP -c -v 'Return for a new token:|LAC:' stderr"
at_fn_check_prepare_notrace 'a shell pipeline' "calc.at:1434"
( $at_check_trace; $EGREP -c -v 'Return for a new token:|LAC:' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
echo >>"$at_stdout"; printf "%s\n" "0
" | \
$at_diff - "$at_stdout" || at_failed=:
at_fn_check_skip $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYABORT.
cat >input <<'_ATEOF'
1 + 2 * 3 + !- ++
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 1 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# YYerror.
# --------
# Check that returning YYerror from the scanner properly enters
# error-recovery without issuing a second error message.
cat >input <<'_ATEOF'
(#) + (#) = 2222
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
1.8: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + #) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(# + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.2: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + # + 1) = 1111
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.6: syntax error: invalid character: '#'
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
cat >input <<'_ATEOF'
(1 + 1) / (1 - 1)
_ATEOF
echo "input:"
sed -e 's/^/ | /' <input
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \$PREPARSER ./calc input"
at_fn_check_prepare_dynamic " $PREPARSER ./calc input" "calc.at:1434"
( $at_check_trace; $PREPARSER ./calc input
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; sed >&2 -e '/^profiling:.*:Merge mismatch for summaries/d' stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
echo stderr:; tee stderr <"$at_stderr"
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Normalize the observed and expected error messages, depending upon the
# options.
# 1. Remove the traces from observed.
sed '
/ \$[0-9$]* = /d
/^Cleanup:/d
/^Discarding/d
/^Entering/d
/^Error:/d
/^LAC:/d
/^Next/d
/^Now/d
/^Reading/d
/^Reducing/d
/^Return/d
/^Shifting/d
/^Stack/d
/^Starting/d
/^state/d
/^yydestructor:/d
' stderr >at-stderr
mv at-stderr stderr
# 2. Create the reference error message.
cat >expout <<'_ATEOF'
1.11-17: error: null divisor
_ATEOF
# 3. If locations are not used, remove them.
# 4. If parse.error is not custom, turn the expected message to
# the traditional one.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: \"\$PERL\" -pi -e 'use strict;
s{syntax error on token \\[(.*?)\\] \\(expected: (.*)\\)}
{
my \$unexp = \$1;
my @exps = \$2 =~ /\\[(.*?)\\]/g;
(\$#exps && \$#exps < 4)
? \"syntax error, unexpected \$unexp, expecting @{[join(\\\" or \\\", @exps)]}\"
: \"syntax error, unexpected \$unexp\";
}eg
' expout || exit 77"
at_fn_check_prepare_notrace 'an embedded newline' "calc.at:1434"
( $at_check_trace; "$PERL" -pi -e 'use strict;
s{syntax error on token \[(.*?)\] \(expected: (.*)\)}
{
my $unexp = $1;
my @exps = $2 =~ /\[(.*?)\]/g;
($#exps && $#exps < 4)
? "syntax error, unexpected $unexp, expecting @{[join(\" or \", @exps)]}"
: "syntax error, unexpected $unexp";
}eg
' expout || exit 77
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
at_fn_diff_devnull "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# 5. If parse.error is simple, strip the', unexpected....' part.
sed 's/syntax error, .*$/syntax error/' expout >at-expout
mv at-expout expout
# 6. Actually check.
{ set +x
printf "%s\n" "$at_srcdir/calc.at:1434: cat stderr"
at_fn_check_prepare_trace "calc.at:1434"
( $at_check_trace; cat stderr
) >>"$at_stdout" 2>>"$at_stderr" 5>&-
at_status=$? at_failed=false
$at_check_filter
at_fn_diff_devnull "$at_stderr" || at_failed=:
$at_diff expout "$at_stdout" || at_failed=:
at_fn_check_status 0 $at_status "$at_srcdir/calc.at:1434"
$at_failed && at_fn_log_failure
$at_traceon; }
# Multiple start symbols.
set +x
$at_times_p && times >"$at_times_file"
) 5>&1 2>&1 7>&- | eval $at_tee_pipe
read at_status <"$at_status_file"
#AT_STOP_526
#AT_START_527
at_fn_group_banner 527 'calc.at:1435' \
"Calculator C++ %header %locations parse.error=verbose %name-prefix \"calc\" %verbose " "" 19
at_xfail=no
(
printf "%s\n" "527. $at_setup_line: testing $at_desc ..."
$at_traceon
cat >calc.y.tmp <<'_ATEOF'